chiral_common/
utils.rs

1//! Utilities
2//! 
3
4const ALPHABET: [char; 36] = [
5    '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 
6    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
7];
8
9pub fn generate_id(length: usize) -> String {
10    nanoid::nanoid!(length, &ALPHABET)
11}
12
13pub fn get_env_var(env_var_name: &str) -> String {
14    std::env::var_os(env_var_name).unwrap().to_string_lossy().to_string()
15}