Documentation
¶
Overview ¶
Package rand implements a cryptographically secure random number generator.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Reader io.Reader
Reader is a global, shared instance of a cryptographically secure random number generator.
On Linux and FreeBSD, Reader uses getrandom(2) if available, /dev/urandom otherwise. On OpenBSD, Reader uses getentropy(2). On other Unix-like systems, Reader reads from /dev/urandom. On Windows systems, Reader uses the CryptGenRandom API. On Wasm, Reader uses the Web Crypto API.
Functions ¶
func Prime ¶
Prime returns a number, p, of the given size, such that p is prime with high probability. Prime will return error for any error returned by rand.Read or if bits < 2.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.