View Single Post
Posts: 19 | Thanked: 6 times | Joined on Jul 2011
#10
Link is dead.... Found the script somewhere else:

In this file you'll find the key in two formats: the ASCII one and the calculated Hex one. Unfortunately the Hex one is stored byte by byte and so the given Hex key has to be converted into a decimal number byte by byte. I was too lazy to do that and wrote a little PHP script to run from the command line.
Code:
#!/usr/bin/php
<?php
if($argc < 2)
{
die("Gimme a key!\n");
}
if(strlen($argv[1]) != 64)
{
die("Not a valid Hex-Key!\n");
}

$hexkey = $argv[1];

$values = array();
for($i = 0; $i < 32; $i++)
{
$values[] = substr($hexkey, 2*$i, 2);
}
foreach($values as $value)
{
echo('        <li type="int" value="'.hexdec($value)."\">\n </li>\n");
}
?>