Function advanced_random_string::generate::generate_unsecure
source · pub fn generate_unsecure(length: usize, charset: &[u8]) -> StringExpand description
Generates a unsecure random string with SmallRng of a specified length using a given character set.
§Arguments
length- The length of the generated string.charset- A slice of bytes representing the character set to use for generating the string.
§Returns
A String containing randomly selected characters from the provided character set.
§Examples
use advanced_random_string::{charset, generate_unsecure};
let random_string = generate_unsecure(10, charset::BASE62);
println!("Generated string: {}", random_string);