mirror of
https://github.com/litruv/unhomoglyph.git
synced 2026-07-26 19:56:14 +10:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f17975f88 | ||
|
|
ef5dfe6afc | ||
|
|
cb57f4472e | ||
|
|
189c8c278c | ||
|
|
0b428f40cf | ||
|
|
fed5576b38 | ||
|
|
77448891d7 | ||
|
|
59c5f0e151 | ||
|
|
0bc3804849 | ||
|
|
ce667c335a |
@@ -1,5 +1,3 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- '4'
|
- node
|
||||||
- '6'
|
|
||||||
sudo: false
|
|
||||||
|
|||||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
1.0.3 / 2019-11-04
|
||||||
|
------------------
|
||||||
|
|
||||||
|
- Update mapping data to version 12.1.0
|
||||||
|
http://www.unicode.org/Public/security/latest/confusables.txt
|
||||||
|
- Dev deps bump.
|
||||||
|
|
||||||
|
1.0.2 / 2017-03-05
|
||||||
|
------------------
|
||||||
|
|
||||||
|
- Update mapping data to version 9.0.0
|
||||||
|
http://www.unicode.org/Public/security/latest/confusables.txt
|
||||||
|
|
||||||
|
|
||||||
1.0.1 / 2016-12-09
|
1.0.1 / 2016-12-09
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -4,8 +4,14 @@
|
|||||||
[](https://www.npmjs.org/package/unhomoglyph)
|
[](https://www.npmjs.org/package/unhomoglyph)
|
||||||
|
|
||||||
> Replace all homoglyphs with base characters. Useful to detect similar strings.
|
> Replace all homoglyphs with base characters. Useful to detect similar strings.
|
||||||
|
For example, to prohibit register similar looking nicknames at websites.
|
||||||
|
|
||||||
Data source - [Recommended confusable mapping for IDN](http://www.unicode.org/Public/security/latest/confusables.txt), v8.0.0.
|
Data source - [Recommended confusable mapping for IDN](http://www.unicode.org/Public/security/latest/confusables.txt), v12.1.0.
|
||||||
|
|
||||||
|
__Note!__ Text after transform is NOT intended be read by humans. For example,
|
||||||
|
`m` will be transformed to `r` + `n`. Goal is to compare 2 strings after
|
||||||
|
transform, to check if sources looks similar or not. If sources look similar,
|
||||||
|
then transformed strings are equal.
|
||||||
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
@@ -21,6 +27,18 @@ npm install unhomoglyph --save
|
|||||||
const unhomoglyph = require('unhomoglyph');
|
const unhomoglyph = require('unhomoglyph');
|
||||||
|
|
||||||
console.log(unhomoglyph('AΑАᎪᗅᴀꓮ')); // => AAAAAAA
|
console.log(unhomoglyph('AΑАᎪᗅᴀꓮ')); // => AAAAAAA
|
||||||
|
console.log(unhomoglyph('m')); // => rn (r + n)
|
||||||
|
|
||||||
|
//
|
||||||
|
// Compare nicknames
|
||||||
|
//
|
||||||
|
|
||||||
|
const username1 = 'm';
|
||||||
|
const username2 = 'rn';
|
||||||
|
|
||||||
|
if (unhomoglyph(username1) === unhomoglyph(username2)) {
|
||||||
|
console.log(`"${username1}" and "${username2} look similar`);
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "unhomoglyph",
|
"name": "unhomoglyph",
|
||||||
"version": "1.0.1",
|
"version": "1.0.3",
|
||||||
"description": "Replace all homoglyphs with base characters.",
|
"description": "Replace all homoglyphs with base characters.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"homoglyph",
|
"homoglyph",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"update": "node update.js && npm test"
|
"update": "node update.js && npm test"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^3.11.1",
|
"eslint": "^6.6.0",
|
||||||
"mocha": "^3.2.0"
|
"mocha": "^6.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user