Giter Site home page Giter Site logo

arx-tools / node-pkware Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 160.4 MB

Node JS implementation of StormLib's Pkware compression/decompression algorithm

License: GNU General Public License v3.0

C 37.74% JavaScript 2.66% C++ 37.68% TypeScript 21.92%
compression arx-fatalis implode pkware explode blast stormlib

node-pkware's People

Contributors

cinderblock avatar meszaros-lajos-gyorgy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

cinderblock gynt

node-pkware's Issues

Using as a library

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();
          },
        })
      );
  });

Decoder seems to not include last block?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.