Last active
March 18, 2016 11:41
-
-
Save tobsn/9711a5e662397a0b93fc to your computer and use it in GitHub Desktop.
char code shifting encode decode
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
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) |
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
$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