Support for multi-member gzip files? #3

Closed
opened 2024-06-07 01:03:47 +02:00 by aaronleopold · 3 comments
aaronleopold commented 2024-06-07 01:03:47 +02:00 (Migrated from github.com)

Hello!

I was wondering if you had any plans to support multi-member gzip files? After some minimal investigation, it looks like it could just be a matter of allowing to specify the MultiDecoder from the libflate library. I'm not sure if there are any other considerations to take into account, but wanted to see if there was any interest in supporting this.

Thanks!

Hello! I was wondering if you had any plans to support multi-member gzip files? After some minimal investigation, it looks like it could just be a matter of allowing to specify the [`MultiDecoder`](https://github.com/sile/libflate/blob/6676d36d381eec60f376337e528d658b16c87c7a/src/gzip.rs#L1052C12-L1055) from the `libflate` library. I'm not sure if there are any other considerations to take into account, but wanted to see if there was any interest in supporting this. Thanks!
ColinTimBarndt commented 2024-06-11 21:11:53 +02:00 (Migrated from github.com)

I'll be looking into it!

I'll be looking into it!
ColinTimBarndt commented 2024-06-12 02:56:31 +02:00 (Migrated from github.com)

I've added options to both compress and decompress in a new minor version (v2.1). The relevant part for you is the following:

import init, { compress, decompress } from "wasm-gzip";

await init();

// A very inefficient way to add strings
const compressed = new Uint8Array(
    (function* () {
        yield* compress("Hello, ");
        yield* compress("World!");
    })(),
);
const combinedRaw = decompress(compressed, { multi: true });
const combined = new TextDecoder().decode(combinedRaw);
// "Hello, World!"
I've added options to both compress and decompress in a new minor version (v2.1). The relevant part for you is the following: ```ts import init, { compress, decompress } from "wasm-gzip"; await init(); // A very inefficient way to add strings const compressed = new Uint8Array( (function* () { yield* compress("Hello, "); yield* compress("World!"); })(), ); const combinedRaw = decompress(compressed, { multi: true }); const combined = new TextDecoder().decode(combinedRaw); // "Hello, World!" ```
aaronleopold commented 2024-06-12 03:12:30 +02:00 (Migrated from github.com)

I appreciate you, thank you!

I appreciate you, thank you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Colin/wasm-gzip#3
No description provided.