Giter VIP home page Giter VIP logo

bspatch-js's Introduction

bspatch

Warning

This project is NOT an exact implementation that complies with the bsdiff4 format used in Colin Percival's bsdiff/bspatch binary.

Colin Percival (and many others) uses bzip2 as the compression algorithm, however it is too slow and I can't find a decent JS implementation that satisfies the tradeoff between binary size & speed. Thus, in this particular implementation gzip (inflate) is used instead.

Usage

bspatch(
  old: Uint8Array,
  patch: Uint8Array
): Promise<Uint8Array>

Deadly simple. Just pass in the old file and the patch file, and you'll get the new file.

Test

 ✓ test/utils.test.ts (1)
 ✓ test/readers.test.ts (1)
 ✓ test/suite.test.ts (1)

  Snapshots  1 obsolete
             ↳ test/suite.test.ts
               · suite name > snapshot 1

 Test Files  3 passed (3)
      Tests  3 passed (3)
   Start at  05:33:43
   Duration  631ms (transform 288ms, setup 0ms, collect 112ms, tests 54ms)

Performance

 ✓ test/suite.bench.ts (1) 635ms
   ✓ existing test data cases (1) 632ms
     name        hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · stages  163.39  5.3894  9.7867  6.1204  6.1873  9.7867  9.7867  9.7867  ±2.92%       82   fastest

License

MIT

bspatch-js's People

Contributors

galvingao avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.