xxHash64 - ActiveState ActiveGo 1.8
...

Package xxHash64

import "github.com/pierrec/xxHash/xxHash64"
Overview
Index
Examples

Overview ▾

Package xxHash64 implements the very fast xxHash hashing algorithm (64 bits version). (https://github.com/Cyan4973/xxHash/)

func Checksum

func Checksum(input []byte, seed uint64) uint64

Checksum returns the 64bits Hash value.

Example

Code:

buf := bytes.NewBufferString("this is a test")
fmt.Printf("%x\n", xxHash64.Checksum(buf.Bytes(), 0xCAFE))

Output:

4228c3215949e862

func New

func New(seed uint64) hash.Hash64

New returns a new Hash64 instance.

Example

Code:

buf := bytes.NewBufferString("this is a test")
x := xxHash64.New(0xCAFE)
x.Write(buf.Bytes())
fmt.Printf("%x\n", x.Sum64())

Output:

4228c3215949e862