issues
search
neerajnanvani
/
PracticeGitAndJs
Its an practice repo to create pull request and use more github features
0
stars
10
forks
source link
Caeser cipher
#65
Closed
saqib-vm1
closed
1 year ago
saqib-vm1
commented
1 year ago
My approach for caeser cipher
Iterate over each character of string using 'map' by splitting the string.
get the character code of a character
if not an alphabet (not from character code 97 to 122) return character without encryption.
shift the character code by 'n'
if greater than 122 (character code for last alphabet 'z') rotate back to start (97 - 'a')
get the character from the shifted character code and return it
join the array returned by the map method to get the encrypted string.
close #64
My approach for caeser cipher
close #64