added pattern tokens help argument
This commit is contained in:
parent
7af9a92785
commit
f9a479f4b5
2 changed files with 22 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue