Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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("");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment