Skip to main content

random_base62

Function random_base62 

Source
pub fn random_base62(rng: &mut impl RngCore, len: usize) -> String
Expand description

Generate a random base62 string of the requested length.

Uses rejection sampling to avoid modulo bias for normal RNG outputs. Includes a deterministic bounded fallback path to avoid hangs with pathological RNGs that never emit acceptable bytes.