facebook / facebook/zstd

Add Public API to Extract Sequences from Frame

Open
#3,520 0 comments 3 reactions 0 assignees View on GitHub
feature request
Dominant language
C
Stars
27.9k
Forks
2.6k
Avg merge
1d 3h
Merged PRs (30d)
8

Description

**Is your feature request related to a problem? Please describe.**
We now have [`ZSTD_compressSequences()`](https://github.com/facebook/zstd/blob/v1.5.4/lib/zstd.h#L1530-L1563), which lets us go from sequences to a frame, but we do not have the reverse, a function that takes a frame and returns the sequences it's composed of.

Such a function would potentially be a useful analysis and debugging tool.

**Describe the solution you'd like**
```
size_t ZSTD_extractSequences(
ZSTD_Sequence* seqs, size_t* seqsSize,
void* literals, size_t* literalsSize,
const void* src, size_t srcSize,
ZSTD_sequenceFormat_e seqFormat);
```

or similar.

You could also eventually imagine a streaming version.

**Describe alternatives you've considered**
We do have [`ZSTD_generateSequences()`], which you could use on a frame after decompressing it to generate new sequences for the same content. But that's not really the same thing.

Edit to add: we need to also provide a buffer into which the extracted literals can be placed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.