You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node:zlib: dictionary option is silently ignored by deflate/inflate #37035
The dictionary option of node:zlib is silently ignored. Compressing with a dictionary produces byte-for-byte the same output as compressing without one, and inflating ignores the dictionary too, so streams compressed with a preset dictionary by Node (or any zlib) can't be decompressed in Deno. Applies to both raw (deflateRawSync/inflateRawSync) and zlib-wrapped (deflateSync) formats.
importzlibfrom"node:zlib";constdictionary=Buffer.from("hello world hello world");constinput=Buffer.from("hello world");constwithDict=zlib.deflateRawSync(input,{ dictionary });constnoDict=zlib.deflateRawSync(input);console.log("with dictionary:",withDict.toString("hex"));console.log("no dictionary: ",noDict.toString("hex"));console.log("identical:",withDict.equals(noDict));// Output produced by Node for the same input + dictionary:constfromNode=Buffer.from("43620200","hex");try{console.log("inflate Node output:",zlib.inflateRawSync(fromNode,{ dictionary }).toString());}catch(e){console.log("inflate Node output threw:",e.message);}
Node v24.18.1:
with dictionary: 43620200
no dictionary: cb48cdc9c95728cf2fca490100
identical: false
inflate Node output: hello world
Deno 2.9.4:
with dictionary: cb48cdc9c95728cf2fca490100
no dictionary: cb48cdc9c95728cf2fca490100
identical: true
inflate Node output threw: invalid distance too far back
Activity