rand

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomBytes

func RandomBytes(n int) ([]byte, error)

RandomBytes Reads n random bytes from the system-specific PRNG and returns them in a byte slice

func RandomBytesS

func RandomBytesS(n int) ([]byte, error)

RandomBytesS Reads n random bytes from the system-specific CSPRNG and returns them in a byte slice

func String

func String(length int) string

String Gets n random bytes of data from the PRNG and returns them as a Go string

func StringS

func StringS(length int) string

StringS Gets n random bytes of data from the CSPRNG and returns them as a Go string

func Uint16

func Uint16() uint16

Uint16 Gets 2 random bytes of data from the PRNG and returns them as a single 16-bit short integer

func Uint16S

func Uint16S() uint16

Uint16S Gets 2 random bytes of data from the CSPRNG and returns them as a single 16-bit short integer

func Uint24

func Uint24() uint32

Uint24 Gets 3 random bytes of data from the PRNG and returns them as a single 24-bit smart integer

func Uint24S

func Uint24S() uint32

Uint24S Gets 3 random bytes of data from the CSPRNG and returns them as a single 24-bit smart integer

func Uint32

func Uint32() uint32

Uint32 Gets 4 random bytes of data from the PRNG and returns them as a single 32-bit integer

func Uint32S

func Uint32S() uint32

Uint32S Gets 4 random bytes of data from the CSPRNG and returns them as a single 32-bit integer

func Uint64

func Uint64() uint64

Uint64 Gets 8 random bytes of data from the PRNG and returns them as a single 64-bit long integer

func Uint64S

func Uint64S() uint64

Uint64S Gets 8 random bytes of data from the CSPRNG and returns them as a single 64-bit long integer

func Uint8

func Uint8() uint8

Uint8 Gets a single random byte of data from the PRNG

func Uint8S

func Uint8S() uint8

Uint8S Gets a single random byte of data from the CSPRNG

Types

This section is empty.

Jump to

Keyboard shortcuts

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