1.0.1 • Published 3 years ago

morphine-crypt v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

morphine-crypt

npm.io

Library for one-way encryption of words.

Example

// ENGLISH 
const MrphCrypt = require('./mrphcrypt');

MrphCrypt.crypt('Hello world', 'en')
.then(cryptedString => console.log(`Crypted string: ${cryptedString}`));

// Crypted string: Helles cowplop clockwork remolds

// RUSSIAN
MrphCrypt.crypt('Привет мир', 'ru')
.then(cryptedString => console.log(`Зашифрованная строка: ${cryptedString}`));

// Зашифрованная строка: Примаков советизирующий мирных

Argument scheme

MrphCrypt.crypt(String, 'en' | 'ru'));

How it works?

The word is split into tokens. A token is three letters of a word. Example. Word: Settings Tokens array: 'Set' 'tin', 'gs'

If the word is not divisible by 3 letters, then all the remaining letters will be the last element of the array.

After receiving the tokens, a search is made in the word base, the script searches for word matches with a separate token. And forms a sentence from these words.

Example

Amagansett abactinally administerings