shift is an integer refers to how much each letter is "shifted" by.input is a string that refers to the inputted text to be encoded or decoded.The caesar() function in the src/caesar.js file has three parameters: When decoding the message, you need to know the number the original message was shifted by so that you can shift in the opposite direction. It relies on taking the alphabet and "shifting" letters to the right or left, based on the typical alphabetic order.įor example, if you were to "shift" the alphabet to the right by 3, the letter "A" would become "D". The Caesar Shift is a type of substitution cipher originally used by Julius Caesar to protect messages of military significance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |