diff --git a/collections/motoko/src/ZhenyaHashmap.mo b/collections/motoko/src/ZhenyaHashmap.mo index 19b7d8df..4547e1c0 100644 --- a/collections/motoko/src/ZhenyaHashmap.mo +++ b/collections/motoko/src/ZhenyaHashmap.mo @@ -9,7 +9,12 @@ import Prim "mo:prim"; actor { stable let profiling = Profiling.init(); - let hash : HashMap.HashUtils = HashMap.n64hash; + let public func hashNat64(key: Nat64): Nat32 { + Prim.nat64ToNat32(key & 0x0fff_ffff); + }; + + let hash : HashMap.HashUtils = (hashNat64, func (x,y) = x == y); + stable var map = HashMap.new(); let rand = Random.new(null, 42);