sil-confusable 0.1.0

Confusable detection engine for the Semantic Integrity Layer — homoglyph detection and cross-script mixing analysis
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub fn to_ascii_equivalent(input: &str) -> String {
    input.chars().map(map_char).collect()
}

fn map_char(c: char) -> char {
    match c {
        'ƒ' => 'f',
        'р' => 'p',
        'а' => 'a',
        'о' => 'o',
        'е' => 'e',
        'с' => 'c',
        'у' => 'y',
        'х' => 'x',
        'і' => 'i',
        _ => c,
    }
}