wikimedia 0.1.1

Download and read wikimedia data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use rand::RngCore;
use std::fmt::Write;

pub fn rand_hex(len: usize) -> String {
    let mut rng = rand::thread_rng();

    let mut bytes = Vec::<u8>::with_capacity(len);
    bytes.resize(len, 0_u8);
    rng.fill_bytes(bytes.as_mut());

    let mut out = String::with_capacity(len * 2);

    for byte in bytes.into_iter() {
        write!(out, "{byte:02x}").expect("no failures writing to a String");
    }

    out
}