#include <cstdint>
#include <span>
#include <vector>
Go to the source code of this file.
|
| auto | nc::Compress (std::span< const char > src, CompressionLevel level=CompressionLevel::Default) -> std::vector< char > |
| | Compress a range of bytes using LZ4/LZ4HC. More...
|
| |
| auto | nc::Decompress (std::span< const char > src, size_t maxDecompressedSize) -> std::vector< char > |
| | Decompress a range of bytes compressed with LZ4/LZ4HC. More...
|
| |
- Copyright
- Jaremie Romer and McCallister Romer 2024
◆ Compress()
| auto nc::Compress |
( |
std::span< const char > |
src, |
|
|
CompressionLevel |
level = CompressionLevel::Default |
|
) |
| -> std::vector< char > |
Compress a range of bytes using LZ4/LZ4HC.
- Parameters
-
| src | The data to compress. Must not exceed compressMaxInputSize. |
| level | The compression level to apply. |
- Returns
- The compressed data as a vector of bytes.
- Exceptions
-
| NcError | is thrown on invalid parameters. |
◆ Decompress()
| auto nc::Decompress |
( |
std::span< const char > |
src, |
|
|
size_t |
maxDecompressedSize |
|
) |
| -> std::vector< char > |
Decompress a range of bytes compressed with LZ4/LZ4HC.
- Parameters
-
| src | The data to decompress. |
| maxDecompressedSize | Size upper bound of the decompressed data. |
- Returns
- The decompressed data as a vector of bytes.
- Exceptions
-
| NcError | is thrown if src is malformed or the specified max size is insufficient. |