Standard library / hash/maphash

hash/maphash.Hash.Sum64()

Return the current unsigned 64-bit hash without consuming input. Equality is not proof of equal input; use original keys to resolve collisions. This is not a cryptographic authentication primitive. Expected stdout: 'true true\n'.

Formal Syntax & Structure

go syntaxgo
func (h *Hash) Sum64() uint64

Return Value

uint64

64-bit unsigned result.

Working Example

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