forked from TrueCloudLab/frostfs-api-go
c82dcf7e16
Also replace seeding into `init` function. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
15 lines
211 B
Go
15 lines
211 B
Go
package random
|
|
|
|
import (
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
func init() {
|
|
rand.Seed(time.Now().UnixNano())
|
|
}
|
|
|
|
// Uint32 returns random uint32 value [0, max).
|
|
func Uint32(max uint32) uint32 {
|
|
return rand.Uint32() % max
|
|
}
|