Function generate_unsecure

Source
pub fn generate_unsecure(length: usize, charset: &[u8]) -> String
Expand 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, random_string};

let random_string = random_string::generate_unsecure(10, charset::BASE62);
println!("Generated string: {}", random_string);