changeset 74 | 7719085707d8 |
parent 69 | 73780a159e15 |
child 75 | 2f39cb7f54c4 |
--- 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; +} +