Files
VoidTeamspeak/include/echoion/protocol/QuickLz.hpp
T
faumaray 38e86d4a07 New arch
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-11 15:06:22 +03:00

24 lines
643 B
C++

#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