linenoise

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 5 Imported by: 2

README

linenoise

Release License

linenoise is a library that generates strings of random characters (herein called a "noise") that can be used as reasonably secure passwords.It is an extraction of the password generator from my prior project genpw, and intended to be genpw's successor.

Interface

linenoise exports one function and one struct.

Noise is the noise-generating function. It is called with a Parameters (see next paragraph.) It returns a string and an error. If the Parameters can be used to create a noise with the desired length, the string is the generated noise and the error is nil. Otherwise, the string is "" and the error is a typical Go error object.

Parameters is a struct containing the following:

  • Length int is the length of the noise desired.
  • Upper bool indicates whether the noise should contain uppercase characters.
  • Lower bool indicates whether the noise should contain lowercase characters.
  • Digit bool indicates whether the noise should contain digits.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mcornick/linenoise.

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

linenoise is available as open source under the terms of the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Noise

func Noise(p Parameters) (string, error)

Noise creates a password of the specified length if it is valid, or an error if the length is invalid.

Types

type Parameters

type Parameters struct {
	Length              int
	Upper, Lower, Digit bool
}

Parameters is a struct containing the length desired and whether we want the different classes of characters in the password.

Jump to

Keyboard shortcuts

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