rand

package
v0.0.0-...-b7732f5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAC [6]byte = getMAC() // One MAC of this machine; Particular case, it is a random bytes.

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