https://github.com/cerchie/caesar-cipher
this function encodes a string you input by your selected Caesar shift
https://github.com/cerchie/caesar-cipher
Last synced: about 1 month ago
JSON representation
this function encodes a string you input by your selected Caesar shift
- Host: GitHub
- URL: https://github.com/cerchie/caesar-cipher
- Owner: Cerchie
- Created: 2021-11-25T17:42:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-07T01:06:53.000Z (over 4 years ago)
- Last Synced: 2025-10-11T02:08:33.849Z (9 months ago)
- Language: JavaScript
- Size: 57.6 KB
- Stars: 1
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# caesar-cipher
this function encodes a string you input by your selected Caesar shift
To use:
`git clone https://github.com/Cerchie/caesar-cipher.git && cd caesar-cipher && node index.js`
If you want to output an encoded string to the terminal you'll need to add a `console.log` that calls the function at the bottom, like so:
`console.log(caesarShift('hello', 6)`
then run `node index.js`
Limitations:
You've got to use a `shiftDegree` between 26 and -26, and your `inputText` must be a string.
PS-- this is a resource that I used: https://stackoverflow.com/questions/5788741/remove-commas-from-the-string-using-javascript
Otherwise, I just used MDN for loop syntax -- I can never remember whether it's `,` or `;` off the top of my head. ;)
I also [wrote a blog post](https://dev.to/cerchie/writing-a-caesar-shift-cipher-function-with-javascript-27eh) about my thought process! I hope you enjoy it.
Marvel quote experiment below:
βIn 1960, the computer at NORAD warned with 99.9% certainty that the Soviets had just launched a full-scale missile attack against North America. NORAD later discovered that the Early Warning System in Greenland had interpreted the moon rising over Norway as a missile attack from Siberia.β