Files
llgo/_demo/go/maphash/maphash.go
xgopilot 8aadfde64a style: apply linter fixes to maphash test
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
Co-authored-by: xgopilot <noreply@goplus.org>
2025-10-14 07:11:42 +00:00

24 lines
343 B
Go

package main
import (
"fmt"
"hash/maphash"
)
func main() {
var h maphash.Hash
h.WriteString("hello")
hash1 := h.Sum64()
fmt.Printf("0x%x\n", hash1)
h.Reset()
h.WriteString("world")
hash2 := h.Sum64()
fmt.Printf("0x%x\n", hash2)
h.Reset()
h.WriteString("hello")
hash3 := h.Sum64()
fmt.Printf("0x%x == 0x%x\n", hash1, hash3)
}