The problem is roughly title, simple binary conversion seems to only get 0 and 1 of the string, not binary data, want to know how to write this code, can try to use PHP built-in functions to implement
The goal is to generate a shorter unique identity, before the use of MD5 again to determine whether to repeat, but the MD5 result is a 32-bit 16 binary string, or a bit long, so want to turn into a 64 binary string, do not know my thinking there is no error?
Reply content:
The problem is roughly title, simple binary conversion seems to only get 0 and 1 of the string, not binary data, want to know how to write this code, can try to use PHP built-in functions to implement
The goal is to generate a shorter unique identity, before the use of MD5 again to determine whether to repeat, but the MD5 result is a 32-bit 16 binary string, or a bit long, so want to turn into a 64 binary string, do not know my thinking there is no error?
Resolved by itself:
function base64md5 ($str) { return base64_encode(md5($str, 1));}
PS: Roughly as above, the phone writes the code, does not guarantee the correct ...
You can use the 16-bit MD5.