commit
38e86d4a07
23 files changed
+3219
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
// QuickLZ level-1 decompression, used to inflate compressed command packets.
|
||||
// Clients send commands uncompressed, so only decompression is needed.
|
||||
// Ported from ts6-manager tslib/quicklz.ts (itself from TSLib QuickerLz.cs).
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
namespace Echoion::Protocol
|
||||
{
|
||||
|
||||
using Bytes = std::vector<uint8_t>;
|
||||
using ByteView = std::span<const uint8_t>;
|
||||
|
||||
uint32_t qlzDecompressedSize(ByteView data);
|
||||
uint32_t qlzCompressedSize(ByteView data);
|
||||
|
||||
// Throws std::runtime_error on malformed input or unsupported level.
|
||||
Bytes qlzDecompress(ByteView data);
|
||||
|
||||
} // namespace Echoion::Protocol
|
||||
Reference in new issue
Block a user