math/rand/v2: document PCG and ChaCha8 tradeoffs Document that ChaCha8 is the general-purpose source resistant to prediction, and that PCG is faster but unfit for security-relevant purposes. Fixes #79891 Change-Id: Ic4133dd9bd860c2643c622f799f2c54b1678e4f0 GitHub-Last-Rev: 93d225108aaef7862f4f148cd926f420e58af831 GitHub-Pull-Request: golang/go#79926 Reviewed-on: https://go-review.googlesource.com/c/go/+/789040 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org>
diff --git a/src/math/rand/v2/rand.go b/src/math/rand/v2/rand.go index 662e84f..991c184 100644 --- a/src/math/rand/v2/rand.go +++ b/src/math/rand/v2/rand.go
@@ -12,6 +12,9 @@ // Top-level functions, such as [Float64] and [Int], // are safe for concurrent use by multiple goroutines. // +// The [ChaCha8] source is a general-purpose source resistant to prediction. +// The [PCG] source is faster but unfit for security-relevant purposes. +// // This package's outputs might be easily predictable regardless of how it's // seeded. For random numbers suitable for security-sensitive work, see the // [crypto/rand] package.