dlwp 0.1.0-alpha

The DLWP library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Checks if a ``String`` is human readable text along with other characters
pub fn is_human_readable_including(text: String, include: Vec<char>) -> bool {
    for c in text.chars() {
        if c.is_alphanumeric() == false {
            if include.contains(&c) == false {
                return false;
            }
        }
    }

    return true;
}

/// Checks if a ``String`` is human readable
pub fn is_human_readable(text: String) -> bool {
    is_human_readable_including(text, vec![])
}