Skip to content

Commit 7cabade

Browse files
shazowrobpike
authored andcommitted
math/rand: warn against using package for security-sensitive work
Urge users of math/rand to consider using crypto/rand when doing security-sensitive work. Related to issue #11871. While we haven't reached consensus on how to make the package inherently safer, everyone agrees that the docs for math/rand can be improved. Change-Id: I576a312e51b2a3445691da6b277c7b4717173197 Reviewed-on: https://go-review.googlesource.com/12900 Reviewed-by: Rob Pike <[email protected]>
1 parent b7205b9 commit 7cabade

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/math/rand/rand.go

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// sequence of values each time a program is run. Use the Seed function to
1010
// initialize the default Source if different behavior is required for each run.
1111
// The default Source is safe for concurrent use by multiple goroutines.
12+
//
13+
// For random numbers suitable for security-sensitive work, see the crypto/rand
14+
// package.
1215
package rand
1316

1417
import "sync"

0 commit comments

Comments
 (0)