<分区>
Possible Duplicate:
How to convert hexadecimal representation of data to binary data in PHP?
如何将基于 md5 哈希字符串的表示形式转换为其原始二进制格式?
请注意 md5($data,true)
不是一个选项,因为我无权访问 $data
但字符串中只有它的 md5 哈希格式。
<分区>
Possible Duplicate:
How to convert hexadecimal representation of data to binary data in PHP?
如何将基于 md5 哈希字符串的表示形式转换为其原始二进制格式?
请注意 md5($data,true)
不是一个选项,因为我无权访问 $data
但字符串中只有它的 md5 哈希格式。
最佳答案
使用 hex2bin http://php.net/manual/de/function.hex2bin.php (这适用于 PHP >= 5.4)
$bin = hex2bin(md5($data));
如果您没有 PHP 5.4,请尝试这样的用户实现 http://devcorner.georgievi.net/pages/programming/php/hex2bin-php
关于php - 如何将像 md5 哈希这样的字符串转换为原始二进制字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13313927/