What is Nostr?
vnprc /
npub16vz…mhgd
2025-01-16 01:55:01
in reply to nevent1q…ng23

vnprc on Nostr: Well this was throwaway code so I didn't commit it. Here is the current version of ...

Well this was throwaway code so I didn't commit it. Here is the current version of that function: https://github.com/vnprc/hashpool/blob/master/protocols/v2/subprotocols/mining/src/cashu.rs#L608

I went with a helper function approach. The code is much cleaner this way. It was a battle to get the u64 out of Amount but even after that I was confused about why I had to interface a u64 with a usize.

Why does core::array:from_fn use usize? I haven't really dealt with this primitive before. Is this related to CPU architecture?

#rust, she is a demanding mistress.
Author Public Key
npub16vzjeglr653mrmyqvu0trwaq29az753wr9th3hyrm5p63kz2zu8qzumhgd