
commit a1a37d335a8e89ac89d85c00c8585d3fc02e064a Author: Josh Baker <joshbaker77@gmail.com> Date: Thu Oct 5 07:36:54 2017 -0700 use symlink instead of copy commit 96399c2c92620f633611c778e5473200bfd48d41 Author: Josh Baker <joshbaker77@gmail.com> Date: Thu Oct 5 07:19:26 2017 -0700 use dep for vendoring
22 lines
433 B
Go
22 lines
433 B
Go
package xxHash64_test
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"github.com/pierrec/xxHash/xxHash64"
|
|
)
|
|
|
|
func ExampleNew() {
|
|
buf := bytes.NewBufferString("this is a test")
|
|
x := xxHash64.New(0xCAFE)
|
|
x.Write(buf.Bytes())
|
|
fmt.Printf("%x\n", x.Sum64())
|
|
// Output: 4228c3215949e862
|
|
}
|
|
|
|
func ExampleChecksum() {
|
|
buf := bytes.NewBufferString("this is a test")
|
|
fmt.Printf("%x\n", xxHash64.Checksum(buf.Bytes(), 0xCAFE))
|
|
// Output: 4228c3215949e862
|
|
}
|