random

package
v0.0.0-...-8fd811e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlphaNum = func(n int) string {
	return String(n, alphaNum)
}

AlphaNum returns a random string of length 'n' using alphanumeric characters, regexp: [a-z0-9]{n}.

View Source
var UUID4 = func() (string, error) {
	uuid, err := uuid.NewRandom()
	if err != nil {
		return "", err
	}
	return uuid.String(), nil
}

UUID4 returns a random generated UUID4.

Functions

func Code

func Code(n int) string

Code returns a random string of length 'n' using only numbers, regexp: [0-9]{n}.

func Hex

func Hex(n int) string

Hex returns a random hex of length 'n', regexp: [a-f0-9]{n}.

func String

func String(n int, chars string) string

String returns a random string of length 'n' using character set 'chars'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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