NcEngine
Compression.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <cstdint>
8#include <span>
9#include <vector>
10
11namespace nc
12{
14enum class CompressionLevel : uint8_t
15{
16 Default,
17 Fast,
18 Max
19};
20
22static constexpr auto compressMaxInputSize = size_t{2113929216};
23
31auto Compress(std::span<const char> src, CompressionLevel level = CompressionLevel::Default) -> std::vector<char>;
32
40auto Decompress(std::span<const char> src, size_t maxDecompressedSize) -> std::vector<char>;
41} // namespace nc
auto Decompress(std::span< const char > src, size_t maxDecompressedSize) -> std::vector< char >
Decompress a range of bytes compressed with LZ4/LZ4HC.
auto Compress(std::span< const char > src, CompressionLevel level=CompressionLevel::Default) -> std::vector< char >
Compress a range of bytes using LZ4/LZ4HC.
CompressionLevel
Option for influencing the compression ratio and speed of nc::Compress().
Definition: Compression.h:15