Node bindings for the compression and decompression functions of libzpaq, written by Matt Mahoney (http://mattmahoney.net/dc/zpaq.html).
These methods handle the decompression of any given zpaq-compressed buffer. Note that this will only decompress the contents, not handle decryption or processing archive structure.
const {decompress} = require("node-zpaq");
async function fn(buffer: Buffer) {
const result = await decompress(buffer);
// ...
}
const {decompressSync} = require("node-zpaq");
function fn(buffer: Buffer) {
const result = decompressSync(buffer);
// ...
}
These methods handle the compression of any given buffer. For a detailed documentation of the compression options, please refer to libzpaq.h.
const {compress} = require("node-zpaq");
const OPTIONS = {
method: "14,128,0",
comment: "Some comment",
fileName: "MyFile.hex",
sha1: true,
};
async function fn(buffer: Buffer) {
const result = await compress(buffer, OPTIONS);
// ...
}
const {compressSync} = require("node-zpaq");
const OPTIONS = {
method: "14,128,0",
comment: "Some comment",
fileName: "MyFile.hex",
sha1: true,
};
function fn(buffer: Buffer) {
const result = compressSync(buffer, OPTIONS);
// ...
}
npm install node-zpaq
node-zpaq is released under the Unlicense, which applies to all files except the files included in /native/zpaq/
.
For these files, the original notice applies:
zpaq is written by Matt Mahoney and released to the public domain.
It includes code from libdivsufsort 2.0 (C) Yuta Mori, 2003-2008, MIT license,
public domain code for AES from libtomcrypt by Tom St Denis
and public domain code for salsa20 by D. J. Bernstein.
By contributing, you agree that your contributions will be licensed under the project's Unlicense.