So...I made my own encoding method...
Code:
String.prototype.aEncode = function(){
var ar = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.!?/&#%=+-~_*'.split(''), a = this.length, x, y = '', z;
var b = ar.length;
if((a+2)%2 == 0){
for(i = 0; i<a;i++){
if((i+2)%2 == 0){
x = ((ar.indexOf(this[i])-a)+b)%b;
y += ar[x];
}
else{
x = ((ar.indexOf(this[i])+a)+b)%b;
y += ar[x];
}
}
}
else{
for(i = 0; i<a;i++){
if((i+2)%2 == 0){
x = ((ar.indexOf(this[i])+a)+b)%b;
y += ar[x];
}
else{
x = ((ar.indexOf(this[i])-a)+b)%b;
y += ar[x];
}
}
}
return y;
}
String.prototype.aDecode = function(){
var ar = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.!?/&#%=+-~_*'.split(''), a = this.length, x, y = '', z;
var b = ar.length;
if((a+2)%2 == 0){
for(i = 0; i<a;i++){
if((i+2)%2 == 0){
x = ((ar.indexOf(this[i])+a)+b)%b;
y += ar[x];
}
else{
x = ((ar.indexOf(this[i])-a)+b)%b;
y += ar[x];
}
}
}
else{
for(i = 0; i<a;i++){
if((i+2)%2 == 0){
x = ((ar.indexOf(this[i])-a)+b)%b;
y += ar[x];
}
else{
x = ((ar.indexOf(this[i])+a)+b)%b;
y += ar[x];
}
}
}
return y;
}
Usage:
Code:
'somestring'.aEncode();//iycoiDhsdq
Not exactly sure why someone would use it, but it's cool. I guess it would be nice for like...keeping messages or a password secret.