• Stars
    star
    1
  • Language
    Go
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Flexible and customizable random string generator

Go random string generator

Build Status Coverage Status Go Report Card GoDoc

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(n uint)

Sets string length to n.

NewLengthRange(min, max uint)

Sets string length to length between min and max

Charset rule function

Modify a charset and returns it.

NewIncludeCharset(chars string)

Add chars to charset.

NewExcludeCharset(chars string)

Removes chars from charset.

Output rule function

NewBeginWith(letters string)

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(n uint)

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.