Namespace: go.std.crypto.rand
v1.0Contents
Summary
Provides a low-level interface to the crypto/rand package.
Package rand implements a cryptographically secure
random number generator.
Index
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
Reader
Var v1.0Reader is a global, shared instance of a cryptographically
secure random number generator.
On Linux, FreeBSD, Dragonfly and Solaris, Reader uses getrandom(2) if
available, /dev/urandom otherwise.
On OpenBSD and macOS, Reader uses getentropy(2).
On other Unix-like systems, Reader reads from /dev/urandom.
On Windows systems, Reader uses the RtlGenRandom API.
On Wasm, Reader uses the Web Crypto API.
Functions, Macros, and Special Forms
-
Int
Function v1.0(Int rand max)
Int returns a uniform random value in [0, max). It panics if max <= 0.
Go input arguments: (rand io.Reader, max *math/big.Int)
Go returns: (n *math/big.Int, err error)
Joker input arguments: [^go.std.io/Reader rand, ^go.std.math.big/*Int max]
Joker returns: [^go.std.math.big/*Int n, ^Error err] -
Prime
Function v1.0(Prime rand bits)
Prime returns a number of the given bit length that is prime with high probability.
Prime will return error for any error returned by rand.Read or if bits < 2.
Go input arguments: (rand io.Reader, bits int)
Go returns: (*math/big.Int, error)
Joker input arguments: [^go.std.io/Reader rand, ^Int bits]
Joker returns: [^go.std.math.big/*Int, ^Error] -
Read
Function v1.0(Read b)
Read is a helper function that calls Reader.Read using io.ReadFull.
On return, n == len(b) if and only if err == nil.
Go input arguments: (b []byte)
Go returns: (n int, err error)
Joker input arguments: [^arrayOfByte b]
Joker returns: [^Int n, ^Error err]
Types
-
(None.)