I am trying to use a method I found in Zhenya Usenko Github:
This is the method (hash function from Nat to Nat32):
func hashNat(key: Nat): Nat32 {
var hash = Prim.intToNat64Wrap(key);
hash := hash >> 30 ^ hash *% 0xbf58476d1ce4e5b9;
hash := hash >> 27 ^ hash *% 0x94d049bb133111eb;
Prim.nat64ToNat32(hash >> 31 ^ hash & 0x3fffffff); // <---- ERROR
};
When I try to dfx generate, I get the error:
type error [M0072], field nat64ToNat32 does not exist in type ...
I looked inside prim.mo, and this method exists. Why is the dfx generate giving me this error?