Verified Commit b1293520 authored by onyinyang's avatar onyinyang 🔒
Browse files

Reset hashkey before generating hash from user bytes

parent c51d89df
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ func NewBucketKey(secret string, distName string) BucketKey {
}

func (b *BucketKey) NewBucketHash(usrBytes []byte) Hashkey {
	b.bucketKey.Reset()
	b.bucketKey.Write(usrBytes)
	h := b.bucketKey.Sum(nil)
	return Hashkey(binary.BigEndian.Uint64(h[:8]))