Posted by CharlesL on 11/05/06 18:45
I am trying to handle binary strings in php. I get a binary output
initialization vector from mcrypt as such:
from mcrypt:
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
This output may have padded nulls at the end which are significant.
I would like to convert all characters including all padding nulls at
end and convert it in a string to be saved into a database in such a way
that I can reconstruct it back to binary again later.
base64_encode and decode is not doing the job. They don't seem to
preserve the original binary value after base64_decode().
Can someone suggest some other way to preserve binary data into ASCII
and back in php?
Navigation:
[Reply to this message]
|