Standard library / hash/maphash

hash/maphash.Hash.Reset()

Discard accumulated input while preserving the seed. This is not a cryptographic authentication primitive. Expected stdout: 'true true\n'.

Formal Syntax & Structure

go syntaxgo
func (h *Hash) Reset()

Working Example

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