Standard library / hash/maphash

hash/maphash.Hash

Incremental seeded hash for hash tables. Zero value initializes a seed lazily. Write boundaries do not change results. Do not share one Hash concurrently; a Seed may be shared. This is not a cryptographic authentication primitive. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
type Hash struct {  // Has unexported fields.}

Working Example

Example Snippetgo
package main
import (  "fmt"  "hash/maphash")
func main() {  var h maphash.Hash  h.WriteString("hello")  fmt.Println(h.Sum64() == maphash.String(h.Seed(), "hello"))}
Go Reference