func MakeImageID() string { mt := mt19937.New() mt.Seed(time.Now().UnixNano()) var buf = make([]byte, 8) binary.BigEndian.PutUint64(buf, mt.Uint64()) return strings.ToUpper(hex.EncodeToString(buf)) }
func generate() chan string { ch := make(chan string) go func() { var zundoko = [2]string{zun, doko} r := rand.New(mt19937.New()) r.Seed(time.Now().UnixNano()) for { ch <- zundoko[r.Intn(2)] } }() return ch }
func main() { num := flag.Int64("num", 0, "number of numbers") max := flag.Int64("max", 0, "max number") flag.Parse() r := rand.New(mt19937.New()) r.Seed(1) i := int64(0) for i = 0; i < *num; i++ { fmt.Printf("%d\n", r.Int63n(*max+1)) } return }
func init() { rng = SafeRNG{rand.New(mt19937.New())} rng.rng.Seed(time.Now().UnixNano()) lock = sync.Mutex{} }
func main() { rng := rand.New(mt19937.New()) rng.Seed(time.Now().UnixNano()) fmt.Println(rng.NormFloat64()) }