Random number generator (included): Difference between revisions
→{{header|Go}}: add issue link, add x/exp/rand
Kinitawowi (talk | contribs) (→{{header|ZX Spectrum Basic}}: slightly more detail; can't link as IE won't show the CAPTCHA and chrome won't store the cookie :/) |
(→{{header|Go}}: add issue link, add x/exp/rand) |
||
Line 412:
=={{header|Go}}==
Go has two random number packages
# [https://golang.org/pkg/math/rand/ math/rand] in the standard library provides general purpose random number support, implementing some sort of feedback shift register. (It uses a large array commented "feeback register" and has variables named "tap" and "feed.") Comments in the code attribute the algorithm to DP Mitchell and JA Reeds. A little more insight is in [https://github.com/golang/go/issues/21835 this issue] in the Go issue tracker.
# [https://golang.org/pkg/crypto/rand/ crypto/rand], also in the standard library, says it "implements a cryptographically secure pseudorandom number generator." I think though it should say that it ''accesses'' a cryptographically secure pseudorandom number generator. It uses <tt>/dev/urandom</tt> on Unix-like systems and the CryptGenRandom API on Windows.
# [https://godoc.org/golang.org/x/exp/rand x/exp/rand] implements the Permuted Congruential Generator which is also described in the issue linked above.
=={{header|Golfscript}}==
|