arx-tools / node-pkware Goto Github PK
View Code? Open in Web Editor NEWNode JS implementation of StormLib's Pkware compression/decompression algorithm
License: GNU General Public License v3.0
Node JS implementation of StormLib's Pkware compression/decompression algorithm
License: GNU General Public License v3.0
Do you have an example of this being used within another node application?
I'm attempting to do so myself but running into issues where implode
actually creates buffers larger than the input. Explode is working great except for one edge case where I am expecting 8192 bytes back but get half of that, 4096. Thanks for your efforts!
Example below is from my nearly completed project: https://github.com/darkmatter-gg/downgrade-replay
const deflate = async (buf) =>
new Promise((res, rej) => {
const t = new Transform({
transform: implode(BINARY_COMPRESSION, DICTIONARY_SIZE3),
});
new Readable({
read: function () {
this.push(buf);
this.push(null);
},
})
.pipe(t)
.pipe(
new Writable({
write(def, enc, done) {
res(def);
done();
},
})
);
});
I'm working on moving my project from implode-decoder
to your node-pkware
.
I have previously gotten a decoder working with implode-decoder
and so wanted to start with getting a side-by-side comparison of your decoders, before moving onto using the encoder as we've talking about in #3.
In the process, I think I've found a bug with your decoder.
Checkout my project. Quick setup:
git clone --branch wip-node-pkware https://github.com/cinderblock/EWD.git
cd EWD
mkdir -p samples
wget -cq --directory-prefix samples https://github.com/cinderblock/3-Phase-Driver/raw/master/Driver.{ewprj,ms14} &
npx npm@7 install
npm run dev -- --verbose samples/*
You will see the last 100 characters of output that were common to both. However, the output of your decoder is 7072
bytes shorter than expected, which the reference decoder gets correctly.
PS, I wrote some TypeScript types for you. Feel free to include them in your sources. I'd be happy to make a separate PR for those if you like.
Looking at https://www.npmjs.com/package/node-pkware, I see a mostly complete README.
Looking here, I see sections to be completed.
Looking at https://unpkg.com/[email protected]/src/implode.mjs, I see that implode
is implemented (at least partially) but here, it does not seem to be implemented.
Looking deeper, it seems you've moved your original sources to _old
... are you doing a rewrite or something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.