Last active
December 17, 2015 01:39
-
-
Save CarlLee/5530309 to your computer and use it in GitHub Desktop.
Ceaser code travese
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ceaser_code = function(comb){ | |
for(var offset = 1; offset < 27; offset++){ | |
var output = ""; | |
for(var i in comb){ | |
var ch = comb.charCodeAt(i); | |
ch = ch + offset > 122? 97 + ch + offset -122: ch+offset; | |
output += String.fromCharCode(ch); | |
} | |
console.log(offset + ':' + output); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment