4 ms·
The author asks about using the same hash function as the builtin Go map. This was recently exposed in the standard lib at https://golang.org/pkg/hash/maphash/
by iand 6y ago
The author asks about using the same hash function as the builtin Go map. This was recently exposed in the standard lib at https://golang.org/pkg/hash/maphash/ https://golang.org/pkg/hash/maphash/
Specifically https://golang.org/src/hash/maphash/maphash.go?s=1316:1346#L203 https://golang.org/src/hash/maphash/maphash.go?s=1316:1346#L... links to the internal hash function.
- mdlayher 6y agoRight, but you can only write strings or bytes to the hash, not integers, booleans, structs, etc. So the problem remains.