randomstring

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: MIT Imports: 3 Imported by: 0

README

Go random string generator

Build Status Coverage Status Go Report Card GoDoc

Usage

import "gopkg.in/randomstring.v1"

Documentation

https://go-randomstring.github.io/

Documentation

Overview

Package randomstring provides function to generate random string based of set of characters.

Index

Constants

View Source
const (
	// LowerLetters is a sets of lowercase latin letters
	LowerLetters = "abcdefghijklmnopqrstuvwxyz"

	// UpperLetters is a set of uppercase latin letters
	UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

	// Digits is a set of digits
	Digits = "1234567890"

	// Symbols is a set of symbols
	Symbols = "!\";#$%&'()*+,-./:;<=>?@[]^_`{|}~"
)

Base characters allowed in a password

Variables

This section is empty.

Functions

func Generate

func Generate(n int, baseChars ...string) string

Generate returns a random string of length n consisting of lower letters, upper letters and digitis

Usage:

randomstring.Generate(20, randomstring.Digits, "@#$^&")

Example output:

1*&$^6^$#*15&$3427$2

Types

This section is empty.

Jump to

Keyboard shortcuts

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