https://github.com/berkekaragoz/caesars-cipher
A library that provides a simple interface to the ceasers cipher for browser and node.js.
https://github.com/berkekaragoz/caesars-cipher
caesar-cipher cryptography mocha typescript typescript-library
Last synced: about 2 months ago
JSON representation
A library that provides a simple interface to the ceasers cipher for browser and node.js.
- Host: GitHub
- URL: https://github.com/berkekaragoz/caesars-cipher
- Owner: BerkeKaragoz
- License: mit
- Created: 2022-05-18T10:31:18.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-19T14:31:43.000Z (about 4 years ago)
- Last Synced: 2025-08-09T02:49:42.583Z (11 months ago)
- Topics: caesar-cipher, cryptography, mocha, typescript, typescript-library
- Language: JavaScript
- Homepage: https://npmjs.com/package/caesars-cipher
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.

You can try it out at the widget at [berkekaragoz.com](https://berkekaragoz.com).
## Usage
```ts
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); // [ string;
type CaesarsDecipher = (cipheredText: string, shiftAmount: number) => string;
```
