kopperdb 0.1.0

Fast key-value store
Documentation
use rand::{Rng, distributions::Alphanumeric};

pub const DB_PATH: &str = "testfiles";
pub const SEGMENT_SIZE: usize = 100;

pub fn random_key_value_with_size(size: usize) -> (String, String) {

    let get_random_str = || {
        rand::thread_rng()
            .sample_iter(&Alphanumeric)
            .take(size)
            .map(char::from)
            .collect()
    };
    (get_random_str(), get_random_str())
}

pub fn random_key_value() -> (String, String) {
    const LEN: usize = 10;
    random_key_value_with_size(LEN)
}