randomizing next file handle id

This commit is contained in:
chrislu
2024-08-07 10:41:58 -07:00
parent 3e6ca6e706
commit 57dc39c451
3 changed files with 11 additions and 3 deletions

View File

@@ -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)