Skip to content

Commit

Permalink
add NewHash{32,64}.
Browse files Browse the repository at this point in the history
Fixes #29
  • Loading branch information
OneOfOne committed Jan 9, 2020
1 parent 8f0be54 commit 85d5025
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xxhash.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package xxhash

import "hash"

const (
prime32x1 uint32 = 2654435761
prime32x2 uint32 = 2246822519
Expand All @@ -22,6 +24,9 @@ const (
zero64x4 = 0x61c8864e7a143579
)

func NewHash32() hash.Hash { return New32() }
func NewHash64() hash.Hash { return New64() }

// Checksum32 returns the checksum of the input data with the seed set to 0.
func Checksum32(in []byte) uint32 {
return Checksum32S(in, 0)
Expand Down

0 comments on commit 85d5025

Please sign in to comment.