caesars-cipher
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

caesars-cipher

A library that provides a simple interface to the caesars cipher with a large range.

Uses the legal range of UTF-8 instead of the regular alphabet: 0x80 (128)

caesars-cipher/base64: Converts to base64 then shifts them. caesars-cipher/uri-encoded: Encodes as uri then shifts them.

image

You can try it out at the widget at berkekaragoz.com.

Usage

import { caesarsCipher, caesarsDecipher } from "caesars-cipher/uri-encoded";
import {
  base64caesarsCipher,
  base64caesarsDecipher,
} from "caesars-cipher/base64";

// uri-encoded
caesarsCipher("Cipher", 10); // Mszro|
caesarsDecipher("Mszro|", 10); // Cipher

// base64
base64caesarsCipher("Cipher", 10); // [<v☺kQ`♥
base64caesarsDecipher("[<v☺kQ`♥", 10); // Cipher

Types:

type CaesarsCipher = (text: string, shiftAmount: number) => string;
type CaesarsDecipher = (cipheredText: string, shiftAmount: number) => string;

image

Package Sidebar

Install

npm i caesars-cipher

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

7.18 kB

Total Files

12

Last publish

Collaborators

  • berkekaragoz