aboutsummaryrefslogtreecommitdiff
path: root/weed/util/bytes.go
diff options
context:
space:
mode:
authorhilimd <68371223+hilimd@users.noreply.github.com>2020-09-25 09:45:56 +0800
committerGitHub <noreply@github.com>2020-09-25 09:45:56 +0800
commit76e24a5660a2192603b7d6d84aef1924ab95cb94 (patch)
tree72e1b320c3487aa5f6cb3cd5fc849bfd94108ec8 /weed/util/bytes.go
parent48c578410fea2128f81356250b2cd9d56074d878 (diff)
parent043b0631369bec00b33eb53cdf2cdef3eced006c (diff)
downloadseaweedfs-76e24a5660a2192603b7d6d84aef1924ab95cb94.tar.xz
seaweedfs-76e24a5660a2192603b7d6d84aef1924ab95cb94.zip
Merge pull request #20 from chrislusf/master
sync
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
+}