homoglyph-detect 0.1.0

Detect Cyrillic/Greek lookalike chars masquerading as ASCII. For prompt-injection and phishing defense. Zero deps.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# homoglyph-detect

[![crates.io](https://img.shields.io/crates/v/homoglyph-detect.svg)](https://crates.io/crates/homoglyph-detect)

Detect Cyrillic / Greek / fullwidth lookalike chars masquerading as
ASCII letters. Catches the `cl\u{0430}ude` trick that bypasses keyword
matching.

```rust
use homoglyph_detect::{find_homoglyphs, normalize_to_ascii};
let attack = "cl\u{0430}ude";
let hits = find_homoglyphs(attack);
assert_eq!(hits[0].ascii_equivalent, 'a');
assert_eq!(normalize_to_ascii(attack), "claude");
```

Zero deps. MIT or Apache-2.0.