aboutsummaryrefslogtreecommitdiff
path: root/weed/util/bytes.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/util/bytes.go')
-rw-r--r--weed/util/bytes.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/util/bytes.go b/weed/util/bytes.go
index 26da91033..482dc3a48 100644
--- a/weed/util/bytes.go
+++ b/weed/util/bytes.go
@@ -148,6 +148,12 @@ func RandomInt32() int32 {
return int32(BytesToUint32(buf))
}
+func RandomUint64() int32 {
+ buf := make([]byte, 8)
+ rand.Read(buf)
+ return int32(BytesToUint64(buf))
+}
+
func RandomBytes(byteCount int) []byte {
buf := make([]byte, byteCount)
rand.Read(buf)