Skip to content

Repository files navigation

Go random string generator

Build StatusCoverage StatusGo Report CardGoDoc

Usage

import"github.com/go-passwd/randomstring"

Documentation

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

Rules functions

Length rule function

Returns a length of a string to generate.

NewLength(nuint)

Sets string length to n.

NewLengthRange(min, maxuint)

Sets string length to length between min and max

Charset rule function

Modify a charset and returns it.

NewIncludeCharset(charsstring)

Add chars to charset.

NewExcludeCharset(charsstring)

Removes chars from charset.

Output rule function

NewBeginWith(lettersstring)

Checks if newly selected at random char does start with a one of letters. Function only executed at first char.

NewNoDuplicateCharacters()

Checks if string doesn't have newly selected at random char.

NewNoSequentialCharacters(nuint)

Checks if string doesn't have n sequentials characters.

Generate rule function

Generates a new string based on: charset, length and output rules.

NewDefaultGenerate()

Simple random string generator.

About

Flexible and customizable random string generator

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages