Use xxhash for high-performance 64-bit hashing
mainxxhash is a Go implementation of the XXH64 algorithm. It is designed to be significantly faster than the hashing algorithms available in the Go standard library.
It provides two main ways to use it:
- One-shot hashing: Use
Sum64orSum64Stringfor immediate results from a byte slice or string. - Streaming hashing: Use the
Digesttype to implement thehash.Hash64interface, allowing you to incrementally write data before computing the final hash.
// One-shot examples
func Sum64(b []byte) uint64
func Sum64String(s string) uint64
// Streaming example using Digest
type Digest struct{ ... }
func New() *Digest