homoglyph-detect 0.1.0

Detect Cyrillic/Greek lookalike chars masquerading as ASCII. For prompt-injection and phishing defense. Zero deps.
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented1 out of 6 items with examples
  • Size
  • Source code size: 19.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 332.65 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 26s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • MukundaKatta/homoglyph-detect
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MukundaKatta

homoglyph-detect

crates.io

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

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.