sergey-dryabzhinsky / python-zstd

Simple python bindings to Yann Collet ZSTD compression library
BSD 2-Clause "Simplified" License
165 stars 27 forks source link

[question] How do I know if a set of bytes was compressed with zstd? #97

Open ItsCubeTime opened 1 year ago

ItsCubeTime commented 1 year ago

How do I know if a set of bytes was compressed with zstd?

chris-ha458 commented 1 year ago

To try to answer your question succinctly, you should look for the Magic_Number which is 4 Bytes, little-endian format. Value : 0xFD2FB528 for ZSTD refer to https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md

I feel like this question is more suitable for the https://github.com/facebook/zstd repo.