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 82e4ddeef..67e6876fa 100644
--- a/weed/util/bytes.go
+++ b/weed/util/bytes.go
@@ -142,3 +142,9 @@ func RandomInt32() int32 {
rand.Read(buf)
return int32(BytesToUint32(buf))
}
+
+func RandomBytes(byteCount int) []byte {
+ buf := make([]byte, byteCount)
+ rand.Read(buf)
+ return buf
+}