基于FastLanes高性能的Zig整数压缩库。Zint内部使用FastLanes,因此实现了完全向量化的差分编码和位打包。安全的解压缩API。可以安全地解压缩不受信任的输入。动态压缩输入中的每个块(1024)元素。如果有利,则自动应用差分编码。
const Z = @require("zint").Zint(T);
const compress_buf = try std.heap.page_allocator.alloc(u8, Z.compress_bound(input.len));
const compressed_size = Z.compress(input, compress_buf);
const compressed = compress_buf[0..compressed_size];
const output = try std.heap.page_allocator.alloc(T, input.len);
try Z.decompress(compressed, output);
std.debug.assert(std.mem.eql(T, output, input));
根据你的选择,以任一方式授权。除非你明确声明,否则你有意提交包含在作品中的任何贡献,如Apache-2.0许可中定义,将以双重许可方式授权,不包含任何其他条款或条件。