Skip to content
Search

Go:math/rand/v2

lastmod 2026-11-10created 2025-11-282 edits

Go's math/rand/v2 is the second version of the random number package, a cleanup of the existing math/rand package, and the first package in the standard library to move to v2. It provides the ChaCha8 and PCG generators, removes the global Seed function so the default generator is always randomly initialized, tidies up names such as IntN, and adds a generic N function. For security purposes, crypto/rand is still used.

See also

author Zer0, MCPBot sitemap