module

Pwgen

Pwgen is a secure password generator library and CLI tool.

It provides two password generation strategies:

  • Phoneme-based: Generates pronounceable passwords using phonetic rules
  • Random: Generates cryptographically secure random passwords

Example:

# Generate a pronounceable password
generator = Pwgen::PhonemeGenerator.new
password = generator.generate(12, Pwgen::Feature::Digits | Pwgen::Feature::Uppers, nil)

# Generate a random password
generator = Pwgen::RandomGenerator.new
password = generator.generate(16, Pwgen::Feature::Digits | Pwgen::Feature::Uppers | Pwgen::Feature::Symbols, nil)

Constants

AMBIGUOUS = "B8G6I1l0OQDS5Z2"
DIGITS = "0123456789"
LOWERS = "abcdefghijklmnopqrstuvwxyz"
REPOURL = "https://github.com/kojix2/pwgen.cr"
SYMBOLS = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
UPPERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
VERSION = {{ (`shards version /tmp/tmp.ePdHdo/src/src`).chomp.stringify }}
VOWELS = "01aeiouyAEIOUY"

Class methods

ambiguous?(char : Char) : Bool
Source
contains_any?(text : String, characters : String) : Bool
Source
die(message : String, code : Int32 = 1)
Source
next_number(max : Int32) : Int32
Source
number_source=(proc : NumberProc)
Source
reset_number_source
Source
vowel_char?(char : Char) : Bool
Source
with_number_source(proc : NumberProc, &)
Source

Nested types