randomize based on self address

fix #851
This commit is contained in:
Chris Lu
2019-01-28 11:55:33 -08:00
parent 221105eea3
commit 6230eb28a6
2 changed files with 11 additions and 0 deletions

9
weed/util/randomizer.go Normal file
View File

@@ -0,0 +1,9 @@
package util
import "hash/fnv"
func HashBytesToInt64(x []byte) int64 {
hash := fnv.New64()
hash.Write(x)
return int64(hash.Sum64())
}