aboutsummaryrefslogtreecommitdiff
path: root/weed/util/randomizer.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/util/randomizer.go')
-rw-r--r--weed/util/randomizer.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/util/randomizer.go b/weed/util/randomizer.go
new file mode 100644
index 000000000..e5ccd3fb3
--- /dev/null
+++ b/weed/util/randomizer.go
@@ -0,0 +1,9 @@
+package util
+
+import "hash/fnv"
+
+func HashBytesToInt64(x []byte) int64 {
+ hash := fnv.New64()
+ hash.Write(x)
+ return int64(hash.Sum64())
+}