Skip to content

Instantly share code, notes, and snippets.

@passcod
Created November 2, 2012 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save passcod/3999184 to your computer and use it in GitHub Desktop.
Save passcod/3999184 to your computer and use it in GitHub Desktop.
enLOLcryption.
String.prototype.enlolcrypt2 = function () {
var cipher = "aeoiubcdfghjklmnpqrstvwxyz";
return this.split("").map(function (T) {
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T);
if (/[^a-z]/.test(T)) { return T; }
if (/[aeoiu]/.test(T)) {
T = cipher[(i+2)%5];
} else {
T = cipher[(i+5)%21+5];
}
return c?T.toUpperCase():T;
}).join("");
}
String.prototype.delolcrypt2 = function () {
var cipher = "aeoiubcdfghjklmnpqrstvwxyz";
return this.split("").map(function (T) {
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T);
if (/[^a-z]/.test(T)) { return T; }
if (/[aeoiu]/.test(T)) {
T = cipher[(i-2)%5];
} else {
T = cipher[(i-15)%21+5];
}
return c?T.toUpperCase():T;
}).join("");
}
@passcod
Copy link
Author

passcod commented Nov 2, 2012

Minified:

String.prototype.lolcrypt2=function(){return this.split("").map(function(a){var b=/[A-Z]/.test(a),a=a.toLowerCase(),b="aeoiubcdfghjklmnpqrstvwxyz",c=b.indexOf(a);if(/[^a-z]/.test(a))return a;a=/[aeoiu]/.test(a)?b[(c+Math.floor(2.5))%5]:b[(c-5+Math.floor(10.5))%21+5];return b?a.toUpperCase():a}).join("")};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment