Standard library / hash/maphash
hash/maphash.Hash.Seed()
Return the current seed, initializing it if necessary. Share it to reproduce hashes within this process. This is not a cryptographic authentication primitive. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (h *Hash) Seed() SeedReturn Value
Seed
Initialized process-local hash seed.
Working Example
Example Snippetgo
package main
import ( "fmt" "hash/maphash")
func main() { var a, b maphash.Hash b.SetSeed(a.Seed()) a.WriteString("Go") b.WriteString("Go") fmt.Println(a.Sum64() == b.Sum64())}