rand

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

golang rand utils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int31

func Int31() int32

Int31 returns a non-negative random 31-bit integer as an int32.

func Int63

func Int63() int64

Int63 returns a non-negative random 63-bit integer as an int64.

func New

func New() (rd [16]byte)

New returns 16-byte raw random bytes. It is not printable, you can use encoding/hex or encoding/base64 to print it.

func NewHex

func NewHex() (rd []byte)

NewHex returns 32-byte hex-encoded bytes.

func Read

func Read(p []byte)

Read reads len(p)-byte raw random bytes to p.

func Uint32

func Uint32() uint32

Uint32 returns a random 32-bit integer as a uint32.

func Uint64

func Uint64() uint64

Uint64 returns a random 64-bit integer as a uint64.

Types

This section is empty.

Jump to

Keyboard shortcuts

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