fn generate_random_name(&mut self) -> String {
		let alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.";
		let alphabet: Vec<char> = alphabet.chars().collect();
		let mut name = String::new();
		let len = self.rng.gen_range(1, 256);

		loop {
			// 12% chance of being random alphanumeric unicode char, otherwise use alphabet above
			let c: char = if self.rng.next_u32() < 0x2000_0000 {
				(&mut self.rng).sample_iter(&rand::distributions::Standard).filter(|c: &char| c.is_alphanumeric()).next().unwrap()
			} else {
				*alphabet.choose(&mut self.rng).unwrap()
			};

			name.push(c);

			if name.len() == len {
				return name;
			}

			if name.len() > len {
				// We want a specific number of bytes (not chars) and the last char went too far.  Try again.
				name.pop();
			}
		}
	}
// Generate a random file name
// Random length.  Randomly includes unicode.
Generate a random file name
Random length.  Randomly includes unicode.
Generate a random file name Random length . Randomly includes unicode .
fn generate_random_name(&mut self) -> String {
		let alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.";
		let alphabet: Vec<char> = alphabet.chars().collect();
		let mut name = String::new();
		let len = self.rng.gen_range(1, 256);
		loop {
			// 12% chance of being random alphanumeric unicode char, otherwise use alphabet above
			let c: char = if self.rng.next_u32() < 0x2000_0000 {
				(&mut self.rng).sample_iter(&rand::distributions::Standard).filter(|c: &char| c.is_alphanumeric()).next().unwrap()
			} else {
				*alphabet.choose(&mut self.rng).unwrap()
			};
			name.push(c);
			if name.len() == len {
				return name;
			}
			if name.len() > len {
				// We want a specific number of bytes (not chars) and the last char went too far.  Try again.
				name.pop();
			}
		}
	}
fn generate_random_name ( & mut self ) -> String { let alphabet = " " ; let alphabet : Vec < char > = alphabet . chars ( ) . collect ( ) ; let mut name = String :: new ( ) ; let len = self . rng . gen_range ( 1 , 256 ) ; loop { // 12% chance of being random alphanumeric unicode char, otherwise use alphabet above let c : char = if self . rng . next_u32 ( ) < 0x2000_0000 { ( & mut self . rng ) . sample_iter ( & rand :: distributions :: Standard ) . filter ( | c : & char | c . is_alphanumeric ( ) ) . next ( ) . unwrap ( ) } else { * alphabet . choose ( & mut self . rng ) . unwrap ( ) } ; name . push ( c ) ; if name . len ( ) == len { return name ; } if name . len ( ) > len { // We want a specific number of bytes (not chars) and the last char went too far.  Try again. name . pop ( ) ; } } }
Generate a random file name
Random length.
Generate a random file name Random length .
&mut self
&mut self