neoneo-go/pkg/util/random.go
2018-01-28 08:05:35 +01:00

16 lines
252 B
Go

package util
import (
"math/rand"
"time"
)
// RandUint32 return a random number between min and max.
func RandUint32(min, max int) uint32 {
n := min + rand.Intn(max-min)
return uint32(n)
}
func init() {
rand.Seed(time.Now().UTC().UnixNano())
}