isaac

package
v0.0.0-...-1047d84 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2019 License: ISC Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISAAC

type ISAAC struct {
	// contains filtered or unexported fields
}

ISAAC The state of the ISAAC CSPRNG

func New

func New(key []uint64) *ISAAC

New Returns a new ISAAC CSPRNG instance.

func (*ISAAC) Int

func (r *ISAAC) Int() int

Int returns a non-negative pseudo-random int.

func (*ISAAC) Int31n

func (r *ISAAC) Int31n(n int32) int32

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

func (r *ISAAC) Int63() (number int64)

Int63 Returns the next 8 bytes as a long integer from the ISAAC CSPRNG receiver instance.

func (*ISAAC) Int63n

func (r *ISAAC) Int63n(n int64) int64

Int63n returns, as an int64, a non-negative pseudo-random number in [0,n). It panics if n <= 0.

func (*ISAAC) Intn

func (r *ISAAC) Intn(n int) int

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

func (r *ISAAC) NextBytes(n int) []byte

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

func (r *ISAAC) NextChar() byte

NextChar Returns the next ASCII character from the ISAAC CSPRNG receiver instance.

func (*ISAAC) Read

func (r *ISAAC) Read(dst []byte) (n int, err error)

func (*ISAAC) String

func (r *ISAAC) String(len int) (ret string)

String Returns the next `len` ASCII characters from the ISAAC CSPRNG receiver instance as a Go string.

func (*ISAAC) Uint16

func (r *ISAAC) Uint16() uint16

Uint16 Returns the next 2 bytes as a short integer from the ISAAC CSPRNG receiver instance.

func (*ISAAC) Uint32

func (r *ISAAC) Uint32() (number uint32)

Uint32 Returns the next 4 bytes as an integer from the ISAAC CSPRNG receiver instance.

func (*ISAAC) Uint64

func (r *ISAAC) Uint64() (number uint64)

Uint64 Returns the next 8 bytes as a long integer from the ISAAC CSPRNG receiver instance.

func (*ISAAC) Uint8

func (r *ISAAC) Uint8() byte

Uint8 Returns the next byte from the ISAAC CSPRNG receiver instance.

func (*ISAAC) Uint8n

func (r *ISAAC) Uint8n(bound byte) (number byte)

Uint8n Returns the next byte as an unsigned 8-bit integer, with an upper bound of n from the ISAAC CSPRNG.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL