如何找到 pack() 二进制数据的格式并解压它
我已将二进制数据存储在 Mysql 字段中,如下所示: 0x31
和 0x31303030303332
。这是从字符串转换为二进制数据,我不知道该字符串,也不知道字符串如何转换为该二进制数据。 据我所知, pack()
和 unpack()
PHP 函数可以帮助我,但我无法将此二进制数据转换回字符串,因为我不这样做知道使用了什么格式(unpack()
函数的第二个参数)。 如何找到正确的格式添加到 unpack('format', $mybinarystring)
函数中? 或者这可以通过另一个函数或方法转换回来吗?
I have stored binary data in Mysql field like this: 0x31
and 0x31303030303332
. this was converted to binary data from string, I don't know that string and I don't know how string had converted to this binary data.
As far as I know the pack()
and unpack()
PHP functions can help me, BUT I can't convert back this binary data to string because I don't know what format (second argument of unpack()
function) had been used.
How can I find correct format to add in unpack('format', $mybinarystring)
function?
Or may be this can be converted back via another function or method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无法确定使用哪种格式来创建二进制数据,因为它只是二进制数据。您可以猜测、查看内容并找到提示,或者只是尝试和错误。
There is no way to definitely find out which format is used to create the binary data, because its just binary data. You can guess, look at the content and find a hint, or just try&error.