Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.37 KB

README.md

File metadata and controls

52 lines (40 loc) · 1.37 KB

golang-passwordGenerator

This package allows cryptographically random passwords to be generated.

Go Reference Go Report Card

Example

package main

import (
	"fmt"

	passwordGenerator "github.com/theTardigrade/golang-passwordGenerator"
)

func main() {
	pg := passwordGenerator.New(
		passwordGenerator.Options{
			Len:                     128,
			IncludeUpperCaseLetters: true,
			IncludeLowerCaseLetters: true,
			IncludeDigits:           true,
			IncludeRunesList: []rune{
				'!', '?', '-', '_', '=', '@', '$',
				'#', '(', ')', '[', ']', '{', '}',
				'<', '>', '+', '/', '*', '\\', '/',
				':', ';', '&', '\'', '"', '%', '^',
				'🙂', '🙃',
			},
			ExcludeAmbiguousRunes: true,
            ExcludeRunesList:      []rune{'a', 'b'},
		},
	)

	passwords, err := pg.GenerateMany(5)
	if err != nil {
		panic(err)
	}

	for _, p := range passwords {
		fmt.Println(p)
	}
}

Support

If you use this package, or find any value in it, please consider donating:

ko-fi