rand

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigInt

func BigInt(max *big.Int) *big.Int

BigInt returns a uniformly-distributed random *big.Int in the range [0, max]. The initial call may block until there is enough entropy in the system; subsequent calls will not block. It panics if max is not non-negative. Note that, unlike crypto/rand.Int, the value returned lies in the closed interval [0,max] not the open interval [0,max).

func Byte

func Byte() byte

Byte returns a uniformly-distributed random byte. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func Byteslice

func Byteslice(b []byte)

Byteslice populates the slice b with uniformly-distributed random bytes. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func ID8

func ID8() string

ID8 generates a random 8 byte ID string. This is not intended for cryptographic use.

func Int16

func Int16() int16

Int16 returns a uniformly-distributed random int16. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func Int32

func Int32() int32

Int32 returns a uniformly-distributed random int32. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func Int64

func Int64() int64

Int64 returns a uniformly-distributed random int64. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func Int8

func Int8() int8

Int8 returns a uniformly-distributed random int8. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func Uint16

func Uint16() uint16

Uint16 returns a uniformly-distributed random uint16. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func Uint32

func Uint32() uint32

Uint32 returns a uniformly-distributed random uint32. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func Uint64

func Uint64() uint64

Uint64 returns a uniformly-distributed random uint64. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

func Uint8

func Uint8() uint8

Uint8 returns a uniformly-distributed random uint8. The initial call may block until there is enough entropy in the system; subsequent calls will not block.

Types

This section is empty.

Jump to

Keyboard shortcuts

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