Crates.io | decancer |
lib.rs | decancer |
version | 3.2.8 |
source | src |
created_at | 2022-07-11 14:48:19.513054 |
updated_at | 2024-10-29 13:43:09.371971 |
description | A library that removes common unicode confusables/homoglyphs from strings. |
homepage | |
repository | https://github.com/null8626/decancer |
max_upload_size | |
id | 623848 |
size | 159,065 |
A library that removes common unicode confusables/homoglyphs from strings.
In your Cargo.toml
:
decancer = "3.2.8"
For more information, please read the documentation.
let mut cured = decancer::cure!(r"vοΌ₯β‘π π½πΕβο½ Ε£δΉππ£ wWiIiIIttHh l133t5p3/-\|<").unwrap();
assert_eq!(cured, "very funny text with leetspeak");
// WARNING: it's NOT recommended to coerce this output to a Rust string
// and process it manually from there, as decancer has its own
// custom comparison measures, including leetspeak matching!
assert_ne!(cured.as_str(), "very funny text with leetspeak");
assert!(cured.contains("funny"));
cured.censor("funny", '*');
assert_eq!(cured, "very ***** text with leetspeak");
cured.censor_multiple(["very", "text"], '-');
assert_eq!(cured, "---- ***** ---- with leetspeak");
If you want to support my eyes for manually looking at thousands of unicode characters, consider donating! β€