mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-11 08:47:46 +02:00
randomizing next file handle id
This commit is contained in:
1 parent
3e6ca6e706
commit
57dc39c451
3 files changed
+11
-3
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user