decancer

A tiny package that removes common unicode confusables/homoglyphs from strings.
- Its core is written in Rust and utilizes a form of Binary Search to ensure speed!
- It's capable of filtering 215,361 (19.33%) different unicode codepoints like:
- All whitespace characters
- All diacritics, this also eliminates all forms of Zalgo text
- Most homoglyphs
- Several emojis
- Unlike other packages, this package is unicode bidi-aware in a way that it also interprets right-to-left characters in the same way as it were to be rendered by an application.
- And it's available in the following languages:
Installation
In your Cargo.toml
:
= "2.0.2"
In your shell:
$ npm install decancer
In your code (CommonJS):
const decancer = require
In your code (ESM):
import decancer from 'decancer'
In your code:
Download
- Library header file
- Download for 64-bit Windows MSVC (Windows 7+)
- Download for 32-bit Windows MSVC (Windows 7+)
- Download for ARM64 Windows MSVC
- Download for 64-bit macOS (10.7+, Lion+)
- Download for ARM64 macOS (11.0+, Big Sur+)
- Download for 64-bit Linux (kernel 3.2+, glibc 2.17+)
- Download for 64-bit Linux with MUSL
- Download for ARM64 Linux (kernel 4.1, glibc 2.17+)
- Download for ARM64 Linux with MUSL
- Download for ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
Building from source
Prerequisites:
$ git clone https://github.com/null8626/decancer.git --depth 1
$ cd decancer/bindings/native
$ cargo build --release
And the binary files should be generated in the target/release
directory.
Examples
For more information, please read the documentation.
let cured = cure.unwrap;
assert_eq!;
assert!;
assert_eq!;
const assert = require
const cured =
console.log
// => 'very funny text'
Decancerer!!! (tm)
Input cancerous text here:
cure!
// global variable for assertion purposes only
decancer_cured_t cured;
static void
static void
int
Contributing
Please read CONTRIBUTING.md
for newbie contributors who want to contribute!