rand

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package rand provide functions for securely generating random strings. It uses crypto/rand to securely generate random sequences of characters. It is adapted from https://gist.github.com/denisbrodbeck/635a644089868a51eccd6ae22b2eb800 to support multiple character sets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASCIIString

func ASCIIString(length int) (string, error)

ASCIIString returns a cryptographically secure random sequence of printable ASCII characters, excluding space.

func AlphaNumericString

func AlphaNumericString(length int) (string, error)

AlphaNumericString returns a cryptographically secure random sequence of alphanumeric characters.

func LowerAlphaNumericString added in v0.1.13

func LowerAlphaNumericString(length int) (string, error)

LowerAlphaNumericString returns a cryptographically secure random sequence of lower alphanumeric characters.

func NewStringGenerator

func NewStringGenerator(characters string) func(int) (string, error)

NewStringGenerator generate a cryptographically secure random sequence generator from given characters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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