Skip to content

Instantly share code, notes, and snippets.

@jason-s13r
Forked from passcod/LOLcryption.js
Created November 2, 2012 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jason-s13r/3999466 to your computer and use it in GitHub Desktop.
Save jason-s13r/3999466 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("");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment