Standard library / hash/maphash
hash/maphash.Bytes()
Hash a byte slice directly under an initialized seed. Equivalent to a fresh Hash with the same seed and bytes. This is not a cryptographic authentication primitive. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func Bytes(seed Seed, b []byte) uint64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| seed | Seed | Initialized process-local seed from MakeSeed or Hash.Seed. |
| b | []byte | Input bytes to hash. |
Return Value
uint64
64-bit unsigned result.
Working Example
Example Snippetgo
package main
import ( "fmt" "hash/maphash")
func main() { s := maphash.MakeSeed() fmt.Println(maphash.Bytes(s, []byte("hello")) == maphash.String(s, "hello"))}