Created
April 10, 2015 12:42
-
-
Save emilniklas/12990932af3f8ae52a53 to your computer and use it in GitHub Desktop.
Gangsta translate
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
function gangstaEncode(normal) | |
{ | |
return input.replace(/([bcdfghjklmnpqrstvwxz])/ig, function (all, $1) | |
{ | |
return $1 + 'o' + $1.toLowerCase(); | |
}); | |
} | |
function gangstaDecode(gangsta) | |
{ | |
return input.replace(/([bcdfghjklmnpqrstvwxz])o\1/ig, '$1'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment