# unhomoglyph

> Replace all homoglyphs with base characters.

Latest version **1.0.6** (published 2020-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install unhomoglyph
pnpm add unhomoglyph
yarn add unhomoglyph
bun add unhomoglyph
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-05-18 |
| First published | 2016-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 104 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 44 |
| Maintainers | vitaly |
| Keywords | homoglyph, homoglyphs |

## Links

- npm: https://www.npmjs.com/package/unhomoglyph
- Repository: https://github.com/nodeca/unhomoglyph
- Homepage: https://github.com/nodeca/unhomoglyph#readme
- Issues: https://github.com/nodeca/unhomoglyph/issues
- npm.io page: https://npm.io/package/unhomoglyph

## Recent versions

- 1.0.6 (latest) — 2020-05-18
- 1.0.5 — 2020-03-03
- 1.0.4 — 2020-02-05
- 1.0.3 — 2019-11-04
- 1.0.2 — 2017-03-05
- 1.0.1 — 2016-12-09
- 1.0.0 — 2016-12-09

## README

# unhomoglyph

[![Build Status](https://img.shields.io/travis/nodeca/unhomoglyph/master.svg?style=flat)](https://travis-ci.org/nodeca/unhomoglyph)
[![NPM version](https://img.shields.io/npm/v/unhomoglyph.svg?style=flat)](https://www.npmjs.org/package/unhomoglyph)

> 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), v13.0.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

```bash
npm install unhomoglyph --save
```


## Example

```js
const unhomoglyph = require('unhomoglyph');

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`);
}
```


## Update

```bash
npm run update
```


## License

[MIT](https://github.com/nodeca/unhomoglyph/blob/master/LICENSE)

---
_Source: https://npm.io/package/unhomoglyph · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
