Usage: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; }
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.Code:'somestring'.aEncode();//iycoiDhsdq
Results 1 to 8 of 8
- 25 Jul. 2013 12:30am #1
So...I made my own encoding method...
- 25 Jul. 2013 02:18am #2
Great job actually.
I love seeing custom encoding algorithms.
But yeah, there wouldn't actually be much use for this.
The thing about an encryption algorithm is that you use the tried and trusted methods.
Not the cool new thing that just came out.
You want the algorithm that has been vulnerability tested for as long as possible so that you know you're getting the most out of your security.I don't get tired.
- 25 Jul. 2013 02:42am #3
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1.45
- 25 Jul. 2013 03:38am #4
- 25 Jul. 2013 01:53pm #5
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1.27
- 25 Jul. 2013 04:34pm #6
- 27 Jul. 2013 08:40pm #7
- 29 Jul. 2013 03:57am #8