识别 blob/二进制数据使用的压缩方法
我有来自数据库的一些二进制数据(blob),我需要知道对它们使用什么压缩方法来解压缩它们。
如何确定使用了什么压缩方法?
I have some binary data (blobs) from a database, and I need to know what compression method was used on them to decompress them.
How do I determine what method of compression that has been used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
实际上更容易。假设使用一种标准方法,开头可能有一些魔术字节。我建议获取前 3-4 个字节的十六进制值并询问 google。
开发自己的压缩是没有意义的,所以......除非情况特殊,或者程序员愚蠢,否则他使用一种众所周知的压缩方法。您还可以选择最流行的图书馆并尝试他们所说的内容。
Actually it is easier. Assume one of the standard methods was used, there possibly are some magic bytes at the beginning. I suggest taiking the hex values of the first 3-4 bytes and asking google.
It makes no sense to develop your own compressions, so... unless the case was special, or the programmer stupid, he used one of the well known compression methods. YOu could also take libraires of the most popular ones and just try what they say.
一般来说,执行此操作的唯一方法是存储存储 BLOB 时使用的压缩方法。
The only way to do this, in general, would be to store which compression method was used when you store the BLOB.
从 db 中的 blob 开始,您可以执行以下操作:
对于我的用例,我使用 DBeaver 导出多个blob 来分隔文件。
在我的例子中,文件是应用程序/zlib;字符集=二进制。
Starting from the blob in db you can do the following:
For my use case I used DBeaver to export multiple blobs to separate files.
In my case the files are
application/zlib; charset=binary
.