rand

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	All = Uppercase | Lowercase | Digit

	Uppercase = 1 << iota
	Lowercase
	Digit
)

List of charsets.

Variables

This section is empty.

Functions

func RandomBytes

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

RandomBytes generates a slice of random bytes.

func RandomHex added in v0.2.0

func RandomHex(n int) (string, error)

RandomHex generates a random hexadecimal string.

func RandomString

func RandomString(n int, charset Charset) (string, error)

RandomString generates a random string.

Types

type Charset

type Charset int

Charset is the data type for random alphabet charset.

Jump to

Keyboard shortcuts

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