Skip to main content

Module generate

Module generate 

Source
Expand description

Strong values the Vault makes itself, so no person types them and no agent sees them (docs/specs/SPEC_VAULT_GENERATE_CAPTURE_AND_BROWSER_SIGNINS_2026_10_28.md §4.1).

Characters are drawn from the OS generator (ring’s SystemRandom) with rejection sampling, so every allowed character is equally likely. The rules take the passwordrules format sites declare on their fields (minlength: 12; maxlength: 32; required: lower; required: digit; allowed: [-_]).

Structs§

Rules
RulesRequest
What a caller asks for: a site’s passwordrules, a length, or words.

Enums§

Style
How a value is built.

Constants§

DEFAULT_LENGTH
DEFAULT_WORDS
MAX_LENGTH
MIN_BITS
Below this a character value is refused: the rules leave too few choices.
MIN_LENGTH

Functions§

bits
How many bits of choice a value under these rules carries.
describe
What the rules were, in a line an agent or the pane can show.
generate
A new value under the rules. It lives only in the returned buffer.
readable
Whether a site’s passwordrules can be read at all. Rules that can be read are the site’s word on what it accepts, even when they leave no strong password; rules that can’t say nothing a caller can follow.
rules
Builds the rules from what was asked. A site’s passwordrules replaces the default classes; length picks a length within its bounds.