passgen

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MPL-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Package passgen generates random passwords.

Example usage:

p := passgen.New() // p is "6NX(W`GD]4:Tqk};Y@A-"

Logic originally from dchest's uniuri library: https://github.com/dchest/uniuri

Functions read from crypto/rand random source, and panic if they fail to read from it.

Index

Constants

View Source
const DefLen = 20

DefLen is the default password length returned.

Variables

View Source
var DefChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()- _=+,.?/:;{}[]`~")

DefChars is the default set of characters used in the password.

Functions

func New

func New() string

New returns a random, unmemorable password of the default length with the default set of characters.

func NewLen

func NewLen(length int) string

NewLen returns a random, unmemorable password of the given length with the default set of characters.

func NewLenChars

func NewLenChars(length int, chars []byte) string

NewLenChars returns a random, unmemorable password of the given length with the given set of characters.

func NewWordish added in v1.1.0

func NewWordish() string

NewWordish generates a password made of word-like words.

Types

This section is empty.

Jump to

Keyboard shortcuts

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