Documentation ¶
Index ¶
- Constants
- type ISAAC
- func (r *ISAAC) Float32() float32
- func (r *ISAAC) Float64() float64
- func (r *ISAAC) Int() int
- func (r *ISAAC) Int31() int32
- func (r *ISAAC) Int31n(n int32) int32
- func (r *ISAAC) Int63() (number int64)
- func (r *ISAAC) Int63n(n int64) int64
- func (r *ISAAC) Intn(n int) int
- func (r *ISAAC) NextBytes(n int) []byte
- func (r *ISAAC) NextChar() byte
- func (r *ISAAC) Read(dst []byte) (n int, err error)
- func (r *ISAAC) Seed(seed int64)
- func (r *ISAAC) String(n int) (ret string)
- func (r *ISAAC) Uint16() uint16
- func (r *ISAAC) Uint32() (number uint32)
- func (r *ISAAC) Uint64() (number uint64)
- func (r *ISAAC) Uint8() byte
- func (r *ISAAC) Uint8n(bound byte) (number byte)
Constants ¶
const MixMask = 0xFF << 2
MixMask is used to shave off the first 2 LSB from certain values during result generation
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISAAC ¶
ISAAC The state representation of the ISAAC CSPRNG
func (*ISAAC) Int31n ¶
Int31n Returns the next 4 bytes as a signed integer of 32 bits, with an upper bound of n from the ISAAC CSPRNG.
func (*ISAAC) Int63 ¶
Int63 Returns the next 8 bytes as a long integer from the ISAAC CSPRNG receiver instance.
func (*ISAAC) Int63n ¶
Int63n returns, as an int64, a non-negative pseudo-random number in [0,n). Returns -1 if provided upper-bound <= 0
func (*ISAAC) Intn ¶
Intn Returns the next 4 bytes as a signed integer of at least 32 bits, with an upper bound of n from the ISAAC CSPRNG.
func (*ISAAC) NextBytes ¶
NextBytes Returns the next `n` bytes from the ISAAC CSPRNG receiver instance, and since ISAAC generates 4-byte words,
if you request a length of bytes that is not divisible evenly by 4, it will stash the remaining bytes into a buffer to be used on your next call to this function.
func (*ISAAC) NextChar ¶
NextChar Returns the next ASCII character from the ISAAC CSPRNG receiver instance.
func (*ISAAC) Seed ¶
this will attempt to shake up the initial state a bit. Algorithm based off of Mersenne Twister's init Not sure if it's of any benefit at all, as ISAAC even when initialized to all zeros is non-uniform
func (*ISAAC) String ¶
String Returns the next `len` ASCII characters from the ISAAC CSPRNG receiver instance as a Go string.
func (*ISAAC) Uint16 ¶
Uint16 Returns the next 2 bytes as a short integer from the ISAAC CSPRNG receiver instance.
func (*ISAAC) Uint32 ¶
Uint32 Returns the next 4 bytes as an integer from the ISAAC CSPRNG receiver instance. Guarenteed non-negative
func (*ISAAC) Uint64 ¶
Uint64 Returns the next 8 bytes as a long integer from the ISAAC CSPRNG receiver instance.