I want to implement a Caesar Cipher shift to increase each letter in a string by 3.
I am receiving this error:
possible loss of precision required
Two ways to implement a Caesar Cipher:
Option 1: Change chars to ASCII numbers, then you can increase the value, then revert it back to the new character.
Option 2: Use a Map map each letter to a digit like this.
A - 0
B - 1
C - 2
etc...
With a map you don't have to re-calculate the shift every time. Then you can change to and from plaintext to encrypted by following map.