Skip to main content

string_from

Function string_from 

Source
pub fn string_from(charset: &[u8], length: usize) -> String
Expand description

Generates a string of length characters sampled from charset.

Each byte becomes the Unicode scalar with the same numeric value, and samples are uniform with replacement. Sampling panics when charset is empty and a positive length is requested.