
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
417 B
Go
22 lines
417 B
Go
package xxHash32_test
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"github.com/pierrec/xxHash/xxHash32"
|
|
)
|
|
|
|
func ExampleNew() {
|
|
buf := bytes.NewBufferString("this is a test")
|
|
x := xxHash32.New(0xCAFE)
|
|
x.Write(buf.Bytes())
|
|
fmt.Printf("%x\n", x.Sum32())
|
|
// Output: bb4f02bc
|
|
}
|
|
|
|
func ExampleChecksum() {
|
|
buf := bytes.NewBufferString("this is a test")
|
|
fmt.Printf("%x\n", xxHash32.Checksum(buf.Bytes(), 0xCAFE))
|
|
// Output: bb4f02bc
|
|
}
|