Closed bkda closed 3 years ago
Thank you!
By the way, I can't find an elegant way to write another test for zstd, so I just wrote a test under the for loop.
Ideally, you can simply replace the existing sample.zst
with your fixture file, that way the existing for loop will cover it too.
Thank you!
By the way, I can't find an elegant way to write another test for zstd, so I just wrote a test under the for loop.
Ideally, you can simply replace the existing
sample.zst
with your fixture file, that way the existing for loop will cover it too.
I want to test both of them, so I added a new sample file.
Looks good to me, thanks for the multiple iterations :)
Zstandard compressed data is made of one or more frames. There are two frame formats defined by Zstandard: Zstandard frames and Skippable frames.
See more details from https://tools.ietf.org/id/draft-kucherawy-dispatch-zstd-00.html#rfc.section.2
The structure of a single Zstandard frame is as follows, the magic number of Zstandard frame is
0xFD2FB528
Skippable Frames
This library can't deal with zstd file with skippable frame, this PR will fix this issue. For example:
In this situation, in front of the magic number of Zstandard frame
0xFD2FB528
, there is a Skippable frame with a magic number0x184D2A50
, so we should parse the Skippable frame, skip the user data, and then check the magic number0xFD2FB528
.By the way, I can't find an elegant way to write another test for zstd, so I just wrote a test under the for loop.