/// Creates a random string of defined length.
/// The numbers are generated using the Hc128 CSPRNG system, and is endorsed by the eSTREAM project.
/// The resulting string is composed of the following characters:
/// All alphanumeric characters (case sensitive) without the following: "0oOIiLl"
/// They are removed to improve readability without impacting much the entropy of the resulting functions.
/// Only a few lengths should be used for the sake of uniformity:
/// - 24 characters (10^41 possibilities) for client secrets & refresh tokens
/// - 64 characters (10^111 possibilities) for machine-to-machine secrets
Creates a random string of defined length.
The numbers are generated using the Hc128 CSPRNG system, and is endorsed by the eSTREAM project.
The resulting string is composed of the following characters:
All alphanumeric characters (case sensitive) without the following: "0oOIiLl"
They are removed to improve readability without impacting much the entropy of the resulting functions.
Only a few lengths should be used for the sake of uniformity:
24 characters (10^41 possibilities) for client secrets & refresh tokens
64 characters (10^111 possibilities) for machine-to-machine secrets
Creates a random string of defined length . The numbers are generated using the Hc128 CSPRNG system and is endorsed by the eSTREAM project . The resulting string is composed of the following characters : All alphanumeric characters ( case sensitive ) without the following : " 0oOIiLl " They are removed to improve readability without impacting much the entropy of the resulting functions . Only a few lengths should be used for the sake of uniformity : 24 characters ( 10^41 possibilities ) for client secrets & refresh tokens 64 characters ( 10^111 possibilities ) for machine - to - machine secrets
pub fn generate_secret(len: usize) -> String {
    RANDOM
        .clone()
        .sample_iter(Uniform::new(0, 55))
        .take(len)
        .map(|e| DICTIONARY.get(e).unwrap())
        .collect()
}
pub fn generate_secret ( len : usize ) -> String { RANDOM . clone ( ) . sample_iter ( Uniform :: new ( 0 , 55 ) ) . take ( len ) . map ( | e | DICTIONARY . get ( e ) . unwrap ( ) ) . collect ( ) }
Creates a random string of defined length.
Creates a random string of defined length .
len
usize