lookalike-util
Made with
Table of Contents
Features
- Removing Invisible Characters: Easily remove invisible characters from strings!
- Clearing Lookalikes: Ridding strings of characters that look like normal english letters/chars!
- Constantly updating Database: Database of lookalikes can update with new ideas!
Installation
With npm
Simply run:
npm i lookalike-util
That's it! You're good to go!
With jsDelivr
In the <head>
of your HTML document, add the following:
<head>
<!-- Other HTML head items -->
<script src="https://cdn.jsdelivr.net/npm/lookalike-util/dist/web/lookalike.js" defer>
</head>
You can now reference using lookalikeUtil
!
Compiling from source
To compile from source, first clone the repository from GitHub:
git clone https://github.com/Status-Plus/lookalike-util.git
git fetch
Then, install all dependencies:
npm i
To run the testing suite, run:
npm test
To build the UMD
compatibile package, run:
npm run build
For lints, run:
npx eslint . --fix
Examples
Via npm:
import { clearSimilar } from '../src/index';
const string = "Êċℎọ!"
console.log(clearSimilar(string)) // returns "Echo!"
Via HTML
<!-- snip -->
<script>
window.lookalikeUtil.clearSimilar('Êċℎọ!'); // returns "Echo!"
</script>
API
clearInvisible(string)
Returns a string
with all "invisible" characters removed. (Not spaces).
Example:
lookalikeutil.clearInvisible("i am a ninja!") // returns string w/o invisible characters!
clearSimilar(string)
Returns a string
with all non-english characters that are abused to look like an english letter to bypass a filter, etc.
Example:
lookalikeutil.clearSimilar("Êċℎọ!") // returns "Echo!"
Usecase
This is used internally by our team in our Discord bot and similar applications with the purpose of removing sneaky characters that are often abused by bad actors to bypass a filter or make it hard to contact them. Someone could bypass a word filter by using these special characters. This soloves that issue!
Contributing
To contribute, please follow the above section regarding compiling from source.
From there, feel free to work using src/index.js
If you would like to contibute to the database, please use lib/lookalike.js
.
Before sending a pull request, please ensure tests, lints, and builds pass. Otherwise, CI will not pass!
License
This project is open-source under the MIT license: