Skip to main content

Crate rusty_pwgen

Crate rusty_pwgen 

Source
Expand description

§rusty-pwgen

A Rust port of Theodore Ts’o’s pwgen utility: generate pronounceable or random passwords from the OS CSPRNG.

§Quick start

use rusty_pwgen::{PwgenBuilder, CompatibilityMode};

let mut pwgen = PwgenBuilder::new()
    .length(12)
    .count(5)
    .compat(CompatibilityMode::Default)
    .build()?;

let passwords: Vec<String> = pwgen.generate_n(5);

§Stability (lockstep SemVer)

Library and binary share a single crate version. The -H reproducible-mode contract (SHA256 + ChaCha20Rng chain) is locked at v0.1.0 — any change is a MAJOR bump.

Re-exports§

pub use error::Error;

Modules§

charset
Active character set builder (FR-006 through FR-010).
cli
Command-line interface — clap derive Cli struct (FR-011 through FR-016).
error
Library-level error type for rusty_pwgen.
mode
Compatibility mode resolution (FR-022).
output
Output formatter (FR-017 through FR-021).
phoneme
Pronounceable algorithm (FR-002, FR-003, FR-004).
rng
RNG sources for rusty-pwgen.
secure
Secure (random) mode generation (FR-005, AD-001).
seed
-H seed input loader (FR-028, FR-029, FR-030).
strict
Strict-mode entry point (FR-022, FR-023, FR-045).

Structs§

Pwgen
Runtime engine for one pwgen invocation. Constructed via PwgenBuilder.
PwgenBuilder
Builder for Pwgen. All chain methods are #[must_use].

Enums§

CompatibilityMode
Whether to apply Default-mode ergonomic extensions or Strict upstream parity.

Constants§

DEFAULT_COUNT_PIPED
Default count when stdout is not a TTY (matches upstream’s 1-password behavior).
DEFAULT_LENGTH
Default password length per upstream pwgen.
DEFAULT_TTY_ROWS
Default count multiplier per row when stdout IS a TTY (matches upstream’s 20 * cols_per_row).

Functions§

run
Binary entry-point helper used by src/main.rs and src/bin/pwgen.rs.