You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rand package uses the math/crypto package from the standard library. The random number generator from crypto is meant to generate secure numbers, and is therefore much slower than math/rand/v2, or even math/rand.
math/rand/v2 was added in 1.22 (we're on 1.23).
It's also a simpler implementation.
// Using math/rand/v2funcnumberMathRandV2() (int64, error) {
returnrandv2.Int64(), nil
}
The text was updated successfully, but these errors were encountered:
The
rand
package uses themath/crypto
package from the standard library. The random number generator fromcrypto
is meant to generate secure numbers, and is therefore much slower thanmath/rand/v2
, or evenmath/rand
.math/rand/v2
was added in 1.22 (we're on 1.23).It's also a simpler implementation.
The text was updated successfully, but these errors were encountered: