Skip to main content
Reduced randomizer again.
Source Link
wolfhammer
  • 1.2k
  • 9
  • 7

JavaScript 257239

var F=String.fromCharCode
function R(l){var k='',i=0;fork='';while(;i<l;i++l--)k+=String.fromCharCodek+=F(~~(Math.random()*26)+65);return k}
function X(s,k,d){var o='',i=0,a,b,c
while(i<s.length)a=s.charCodeAt(i)-65,b=k.charCodeAt(i++)-65,c=d?26+(a-b):a+b,o+=String.fromCharCodeo+=F((c%26)+65)
return o
 }

Usage:

var str = "HELLOWORLD";
var key = R(str.length);
var enc = X(str, key, false);
console.log(enc);
console.log(X(enc,key, true));

JavaScript 257

function R(l){var k='',i=0;for(;i<l;i++)k+=String.fromCharCode(~~(Math.random()*26)+65);return k}
function X(s,k,d){var o='',i=0,a,b,c
while(i<s.length)a=s.charCodeAt(i)-65,b=k.charCodeAt(i++)-65,c=d?26+(a-b):a+b,o+=String.fromCharCode((c%26)+65)
return o
 }

Usage:

var str = "HELLOWORLD";
var key = R(str.length);
var enc = X(str, key, false);
console.log(enc);
console.log(X(enc,key, true));

JavaScript 239

var F=String.fromCharCode
function R(l){var k='';while(l--)k+=F(~~(Math.random()*26)+65);return k}
function X(s,k,d){var o='',i=0,a,b,c
while(i<s.length)a=s.charCodeAt(i)-65,b=k.charCodeAt(i++)-65,c=d?26+(a-b):a+b,o+=F((c%26)+65)
return o}

Usage:

var str = "HELLOWORLD";
var key = R(str.length);
var enc = X(str, key, false);
console.log(enc);
console.log(X(enc,key, true));
reduced randomizer
Source Link
wolfhammer
  • 1.2k
  • 9
  • 7

JavaScript 276257

function R(lenl){var k='',r,i=0
fori=0;for(;i<len;i++;i<l;i++)r=Mathk+=String.floorfromCharCode(~~(Math.random()*26),k+=String.fromCharCode(r+65+65)
return;return k
 }
function X(s,k,d){var o='',i=0,a,b,c
while(i<s.length)a=s.charCodeAt(i)-65,b=k.charCodeAt(i++)-65,c=d?26+(a-b):a+b,o+=String.fromCharCode((c%26)+65)
return o
}

Usage:

var str = "HELLOWORLD";
var key = R(str.length);
var enc = X(str, key, false);
console.log(enc);
console.log(X(enc,key, true));

JavaScript 276

function R(len){var k='',r,i=0
for(;i<len;i++)r=Math.floor(Math.random()*26),k+=String.fromCharCode(r+65)
return k
 }
function X(s,k,d){var o='',i=0,a,b,c
while(i<s.length)a=s.charCodeAt(i)-65,b=k.charCodeAt(i++)-65,c=d?26+(a-b):a+b,o+=String.fromCharCode((c%26)+65)
return o
}

Usage:

var str = "HELLOWORLD";
var key = R(str.length);
var enc = X(str, key, false);
console.log(enc);
console.log(X(enc,key, true));

JavaScript 257

function R(l){var k='',i=0;for(;i<l;i++)k+=String.fromCharCode(~~(Math.random()*26)+65);return k}
function X(s,k,d){var o='',i=0,a,b,c
while(i<s.length)a=s.charCodeAt(i)-65,b=k.charCodeAt(i++)-65,c=d?26+(a-b):a+b,o+=String.fromCharCode((c%26)+65)
return o
}

Usage:

var str = "HELLOWORLD";
var key = R(str.length);
var enc = X(str, key, false);
console.log(enc);
console.log(X(enc,key, true));
Source Link
wolfhammer
  • 1.2k
  • 9
  • 7

JavaScript 276

function R(len){var k='',r,i=0
for(;i<len;i++)r=Math.floor(Math.random()*26),k+=String.fromCharCode(r+65)
return k
}
function X(s,k,d){var o='',i=0,a,b,c
while(i<s.length)a=s.charCodeAt(i)-65,b=k.charCodeAt(i++)-65,c=d?26+(a-b):a+b,o+=String.fromCharCode((c%26)+65)
return o
}

Usage:

var str = "HELLOWORLD";
var key = R(str.length);
var enc = X(str, key, false);
console.log(enc);
console.log(X(enc,key, true));