ws-roblox: codecs/compress/Lz4 (LZ4 block decode + encode, decodeInto with history for linked blocks), tests vs python-lz4 both ways, bench line

This commit is contained in:
4DBug committed 2026-10-31 13:53:23 -05:00
1 parent de4f14a343
commit 1ed25296ba
6 files changed
+510 -1

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
-- tools/fixtures/_lz4_encode.luau: run by tools/fixtures/lz4.py under the luau CLI: compresses every corpus of
-- tests/gen/lz4_corpora with codecs/compress/Lz4 and prints "<name> <hex>" lines for the reference to decompress.
local Lz4 = require("@formats/codecs/compress/Lz4")
local C = require("@tests/gen/lz4_corpora")
for name, data in C do
local b = assert(Lz4.compress(data))
local t = table.create(buffer.len(b))
for i = 0, buffer.len(b) - 1 do
t[i + 1] = string.format("%02x", buffer.readu8(b, i))
end
print(name .. " " .. table.concat(t))
end