@@ -32,7 +32,7 @@ func main() {
|
||||
// produce the same sequence of numbers each time by default.
|
||||
// To produce varying sequences, give it a seed that changes.
|
||||
// Note that this is not safe to use for random numbers you
|
||||
// intend to be secret, use `crypto/rand` for those.
|
||||
// intend to be secret; use `crypto/rand` for those.
|
||||
s1 := rand.NewSource(time.Now().UnixNano())
|
||||
r1 := rand.New(s1)
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
f0f88939692a32975d902c94066537a6ba5ab96f
|
||||
RaoKyUd9tgC
|
||||
ea6a386e4e5602247b2203fa433d4419ff5a9489
|
||||
Enb5uJEx0Bt
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
# Depending on where you run this sample, some of the
|
||||
# generated numbers may be different. Note that on
|
||||
# the Go playground seeding with `time.Now()` still
|
||||
# produces deterministic results due to the way the
|
||||
# playground is implemented.
|
||||
$ go run random-numbers.go
|
||||
81,87
|
||||
0.6645600532184904
|
||||
|
||||
Reference in New Issue
Block a user