Skip to content

Commit

Permalink
templates: improve zstd
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlindhe committed Jan 11, 2024
1 parent 68283e2 commit dad441a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions templates/archives/zstd.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# STATUS: 70%

# TODO access value of Block_Size, auto bit shifted
# TODO add support for xxh64 hash
# TODO need more samples

references:
- https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md

kind: archive
name: ZStd compressed data stream
extensions: [.zstd]
extensions: [.zst, .zstd]
endian: little

magic:
Expand Down Expand Up @@ -47,6 +48,8 @@ structs:

if (self.Frame_Header_Descriptor & Single_Segment_flag) == 0:
u8 Window_Descriptor: ??
else:
u8 Frame_Content_Size: ?? # XXX can be 1,2,4 or 8 bytes long, need samples

# Dictionary_ID 0-4 bytes
if (self.Frame_Header_Descriptor & Dictionary_ID_flag) == 1:
Expand All @@ -73,7 +76,7 @@ structs:
# N bytes of Block_Content
if (self.Block_Header & Last_Block) == 1:
if (Frame.Frame_Header_Descriptor & Content_Checksum_flag) != 0:
u32 ContentChecksum: ??
u32 ContentChecksum: ?? # XXX xxh64 hash
parse: stop

layout:
Expand Down

0 comments on commit dad441a

Please sign in to comment.