randstr

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: MIT Imports: 2 Imported by: 0

README

randstr

Documentation

Overview

Package randstr provides functions for generation random strings using presets of allowed characters.

Index

Constants

This section is empty.

Variables

View Source
var (
	// AlphaDigit holds 0..9, A..Z, a..z.
	AlphaDigit = []byte(digits + lowerchars + upperchars)

	// LowerAlphaDigit holds a..z.
	LowerAlphaDigit = []byte(digits + lowerchars)

	// UpperAlphaDigit holds A..Z
	UpperAlphaDigit = []byte(digits + upperchars)

	// DecimalDigit holds 0..9.
	DecimalDigit = []byte(digits)

	// HexDigit holds 0..9, A..F.
	HexDigit = []byte(digits + "ABCDEF")

	// Password hold 0..9, A..Z, a..z and  ~!@#$^&*()-+[]
	Password = []byte(digits + lowerchars + upperchars + symbols)
)

Functions

func RandomString

func RandomString(src []byte, size int) string

RandomString returns random string. Parameter src is used as a list of allowed characters, size result length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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