mirror of
https://github.com/raz-varren/sacrificial-socket.git
synced 2025-10-08 09:30:05 +08:00
let there be websockets
This commit is contained in:
16
tools/random.go
Normal file
16
tools/random.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package tools
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func RandomInt(min, max int) int {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
return rand.Intn(max-min+1) + min
|
||||
}
|
||||
|
||||
func RandomInt64(min, max int64) int64 {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
return rand.Int63n(max-min+1) + min
|
||||
}
|
Reference in New Issue
Block a user