Skip to content

Instantly share code, notes, and snippets.

@tobsn
Last active March 18, 2016 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobsn/9711a5e662397a0b93fc to your computer and use it in GitHub Desktop.
Save tobsn/9711a5e662397a0b93fc to your computer and use it in GitHub Desktop.
char code shifting encode decode
var z='',x='',s = 'now.something.com';
for( var i = 0; i < s.length; i++ ){
x += String.fromCharCode(s.charCodeAt(i)^6);
}
console.log(x)
for( var i = 0; i < x.length; i++ ){
z += String.fromCharCode(6^x.charCodeAt(i));
}
console.log(z)
$s = strrev(implode('',array_map(function($c){return chr(6^ord($c));},str_split($s))));
echo strrev(implode('',array_map(function($c){return chr(ord($c)^6);},str_split($s))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment