So the field hash for Nat and Int is deprecated but I need a TrieMap with a Nat as its key. Problem is, I really don’t know how to write a hash function or what to consider when hashing a Nat. I thought the following would work, but it’s giving me both the warning about the deprecated hash field and an error:
let myDB = TrieMap.TrieMap<Nat, Text>(Nat.equal, Hash.hash(Nat));
Hi Aaron! I just went ahead and ignored the warning since I’m only dealing with low values anyway. The reason I decided to stick with Nat instead of changing the type to Nat32 was - if I’m not mistaken - that Nat still has a lower memory footprint than Nat32. At least that’s what I read somewhere.