Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using static dictionary, inflateRaw "Uncaught invalid stored block lengths" #284

Closed
SaulMoonves opened this issue Mar 4, 2024 · 0 comments

Comments

@SaulMoonves
Copy link

$ zstd --verbose --train out/*.js -o out/dict --maxdict=17KB
*** Zstandard CLI (64-bit) v1.5.5, by Yann Collet ***
Shuffling input files
Trying 5 different sets of parameters
d=8
Training on 828 samples of total size 1210397
Testing on 276 samples of total size 402523
Computing frequencies
k=50
Breaking content into 348 epochs of size 3478
statistics ...
k=537
Breaking content into 32 epochs of size 37824
statistics ...
k=1024
Breaking content into 17 epochs of size 71199
statistics ...
k=1511
Breaking content into 11 epochs of size 110035
statistics ...
k=1998
Breaking content into 8 epochs of size 151298
statistics ...
k=1998
d=8
f=20
steps=4
split=75
accel=1
Save dictionary of size 17408 into file out/dict
for FILE in `ls out/*.js`; do zstd  --force -D out/dict -o ${FILE}.zst ${FILE}; done
out/0001.js          : 13.57%   (  1.58 KiB =>    219 B, out/0001.js.zst)
out/0002.js          :  9.71%   (  1.59 KiB =>    158 B, out/0002.js.zst)
out/0003.js          : 10.85%   (  1.58 KiB =>    175 B, out/0003.js.zst)
out/0004.js          :  9.65%   (  1.54 KiB =>    152 B, out/0004.js.zst)
...

Now when I do:

pako.inflateRaw(file0001, { dictionary: dict });

I get:

Uncaught invalid stored block lengths
inflate @ pako_inflate.js:3185
inflateRaw @ pako_inflate.js:3202
(anonymous) @ VM3891:1

What am I doing wrong? I confirmed zstd can use the dictionary to inflate again.

I am pretty desperate to make this work and very short on time. I am willing put a 200 dollar bounty on an answer within this evening.

files.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant