Skip to content

Max size necessary for output buffer when compressing #1

@nemequ

Description

@nemequ

I'm thinking about adding a Squash plugin for squish, but I don't see a way to determine the destination buffer size necessary to store a specified number of bytes of source material under the worst-case scenario (like random data).

It would be good to have at least a description of how to calculate that (e.g., from the bzip2 documentaion: "To guarantee that the compressed data will fit in its buffer, allocate an output buffer of size 1% larger than the uncompressed data, plus six hundred extra bytes."), or even better a macro or function to calculate it (like compressBound in zlib or LZ4_COMPRESSBOUND/LZ4_compressBound in LZ4).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions