caesar-crypter
Encrypts text using a Caesar cipher
Installation
$ npm i caesar-crypter
Example
const caesarCrypter = ; // Encrypt the 'ab' message using base string 'abcdefgh', step 1, direction -1console; // 'ha'// Decrypt the 'ha' message using base string 'abcdefgh', step 1, direction -1console; // 'ab'
Documentation
encrypt(steps, direction, arrAlph, arr)
generateCryptedString Creates an array based on another array using steps and direction.
Params
- Number
steps
: The offset range (How many characters you want to jump). - Number
direction
: If positive jump right. If negative jump left. - String
arrAlph
: The base array that will be used for encryption. - String
arr
: The array to be encrypted.
Return
- Array Encrypted array.
decrypt(steps, direction, arrAlph, arr)
decryptCryptedString Creates an array based on another array using steps and direction.
Params
- Number
steps
: The offset range (How many characters you want to jump). - Number
direction
: If positive jump right. If negative jump left. - String
arrAlph
: The base array that will be used for decryption. - String
arr
: The array to be decrypted.
Return
- Array Decrypted array.
How to contribute
Have an idea? Found a bug? See how to contribute.
License
See the LICENSE file.