Trait armnod::CharacterChooser
source · pub trait CharacterChooser {
// Required methods
fn which_char(&mut self, guac: &mut Guacamole) -> char;
fn whole_string(&mut self, bytes: &mut [u8]) -> String;
}Expand description
Generate strings of a given alphabet using the provided randomness.
Required Methods§
sourcefn which_char(&mut self, guac: &mut Guacamole) -> char
fn which_char(&mut self, guac: &mut Guacamole) -> char
Generate a single char according to the distribution, using guac.
sourcefn whole_string(&mut self, bytes: &mut [u8]) -> String
fn whole_string(&mut self, bytes: &mut [u8]) -> String
Generate a string equal in length to bytes, using each character of bytes as a random
value to pick another character. NOTE(rescrv): This implies the CharacterChooser API
only supports 256 distinct characters at a time, and I’m OK with that.