added pattern tokens help argument

This commit is contained in:
ika4422 2026-04-08 13:29:43 +01:00
parent 7af9a92785
commit f9a479f4b5
No known key found for this signature in database
GPG key ID: F7FBF981D2A33785
2 changed files with 22 additions and 2 deletions

View file

@ -8,6 +8,17 @@ const ALNUM_LOWER: &[u8] = b"0123456789abcdefghijklmnopqrstuvwxyz";
const ALNUM_UPPER: &[u8] = b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const ALNUM_MIXED: &[u8] = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
pub const TOKEN_HELP: &str = "\
Pattern Tokens:
n digit (0-9)
l letter lower (a-z)
L letter upper (A-Z)
m letter mixed (a-z, A-Z)
a alnum lower (0-9, a-z)
A alnum upper (0-9, A-Z)
x alnum mixed (0-9, a-z, A-Z)
* any other character is used literally";
fn pick(rng: &mut impl rand::Rng, pool: &[u8]) -> char {
pool[rng.random_range(0..pool.len())] as char
}