pub fn mask_str(str: &str) -> String {
    let len = str.chars().by_ref().count();
    let split = len / 2;
    let split2 = split / 2;
    let mut res = String::new();
    let mut chars = str.chars();
    res.extend(chars.by_ref().take(split2));
    res.push_str(&"*".repeat(split));
    let _ = chars.by_ref().take(split).count();
    res.extend(chars);
    res
}

pub fn limit_str(str: &str, limit: usize) -> String {
    let len = str.chars().by_ref().count();
    if len > limit {
        let mut chars = str.chars();
        let mut string = chars.by_ref().take(limit).collect::<String>();
        string.push_str("..");
        string
    } else {
        str.to_owned()
    }
}