Skip to content

This Go package allows cryptographically random passwords to be generated.

License

Notifications You must be signed in to change notification settings

theTardigrade/golang-passwordGenerator

Repository files navigation

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

About

This Go package allows cryptographically random passwords to be generated.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages