ICE Key Generator: Difference between revisions
Jump to navigation
Jump to search
m (categorized (page needs content!)) |
(Explained purpose.) |
||
| Line 1: | Line 1: | ||
This is a simple HTML script that can be used to randomly generate an encryption code for use with [[Vice]]. Note that this does not generate a code for a specific game; its intent is for developers to get a completely random key to use for their own mod(s). | |||
==Source code== | ==Source code== | ||
Revision as of 18:55, 22 February 2008
This is a simple HTML script that can be used to randomly generate an encryption code for use with Vice. Note that this does not generate a code for a specific game; its intent is for developers to get a completely random key to use for their own mod(s).
Source code
<script language="JavaScript" type="text/javascript">
var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()_+-=[]{};/., ~`:<>?';
var l = chars.length-1;
document.write('<span style="font-size:5em;">');
for(var x=0;x<=7;x++)
{
var chr = chars.charAt(Math.round(Math.random(new Date().getSeconds())*l));
var out;
switch(chr)
{
case '<':
out = '<';
break;
case '>':
out = '>';
break;
case '&':
out = '&';
break;
default:
out = chr;
break;
}
document.write(out);
}
document.write('</span>');
</script>