9 lines
358 B
JavaScript
9 lines
358 B
JavaScript
// inflateRaw — распаковка deflate-raw (метод 8) через нативный DecompressionStream.
|
|
|
|
export async function inflateRaw(bytes) {
|
|
const ds = new DecompressionStream('deflate-raw');
|
|
const stream = new Blob([bytes]).stream().pipeThrough(ds);
|
|
const ab = await new Response(stream).arrayBuffer();
|
|
return new Uint8Array(ab);
|
|
}
|