Giter Club home page Giter Club logo

lz77's People

Contributors

whoughton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lz77's Issues

Changing minStringLength causes roundtripping to fail

Repro:

var lz = require('lz77');

var settings = {
    minStringLength: 6
};

var to_compress = "can't read my, can't read my, no he can't read my poker face";
console.log(to_compress);
var compressed = lz.compress(to_compress, settings);
console.log(compressed);
var decompressed = lz.decompress(compressed, settings);
console.log(decompressed);
console.assert(to_compress === decompressed);

Outputs:

can't read my, can't read my, no he can't read my poker face
can't read my, ca` "'no he` '( poker face
can't read my, can't read my, o he, can't read mpoker face

And trips the assertion. This also happens when setting it to below the default value of 5.

lz77 version = 1.1.0
node version = v6.5.0

String isn't compressed even though it seems like it should be

Repro:

var lz = require('lz77');

var settings = {
    minStringLength: 5
};

var to_compress = 'hello hello baby you called I can\'t hear a thing';
console.log(to_compress);
var compressed = lz.compress(to_compress, settings);
console.log(compressed);
console.assert(to_compress === compressed);

minStringLength is set to 5 (the default), and there's a repeating substring of length 6 (hello ), so it seems like that should get replaced with a reference?

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.