Skip to content

Instantly share code, notes, and snippets.

@CarlLee
Last active December 17, 2015 01:39
Show Gist options
  • Save CarlLee/5530309 to your computer and use it in GitHub Desktop.
Save CarlLee/5530309 to your computer and use it in GitHub Desktop.
Ceaser code travese
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