diff -r 1f55c324efcf -r 7719085707d8 functions.php --- a/functions.php Fri Jun 12 11:38:43 2009 -0400 +++ b/functions.php Fri Jun 12 11:57:08 2009 -0400 @@ -333,3 +333,21 @@ } } +/** + * Decodes a hex string. + * @param string $hex The hex code to decode + * @return string + */ + +function hexdecode($hex) +{ + $hex = str_split($hex, 2); + $bin_key = ''; + foreach($hex as $nibble) + { + $byte = chr(hexdec($nibble)); + $bin_key .= $byte; + } + return $bin_key; +} +