diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2020-09-25 09:45:56 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-25 09:45:56 +0800 |
| commit | 76e24a5660a2192603b7d6d84aef1924ab95cb94 (patch) | |
| tree | 72e1b320c3487aa5f6cb3cd5fc849bfd94108ec8 /weed/util/bytes.go | |
| parent | 48c578410fea2128f81356250b2cd9d56074d878 (diff) | |
| parent | 043b0631369bec00b33eb53cdf2cdef3eced006c (diff) | |
| download | seaweedfs-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.go | 6 |
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 +} |
