vitorio / jslzjb

Javascript port of the LZJB compression algorithm (http://en.wikipedia.org/wiki/LZJB).
https://code.google.com/archive/p/jslzjb/
1 stars 0 forks source link

Doesn't compress and decompress properly #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
// Decompressed value comes out as 'wo' instead of 'two'
test('jslzjb', function(){
    var s = "two";
    var c = Iuppiter.compress(s);
    ok(c.length < s.length,c);

    var d = Iuppiter.decompress(c);
    ok(d == s,d);

    // Compressed byte array can be converted into base64 to sumbit to server side to do something.
    var b = Iuppiter.Base64.encode(c, true);

    var bb = Iuppiter.toByteArray(b);
    var db = Iuppiter.decompress(Iuppiter.Base64.decode(bb, true));
    ok(db == s,db);
})

Original issue reported on code.google.com by jabo...@gmail.com on 23 Jul 2013 at 7:54

GoogleCodeExporter commented 9 years ago
I see this too on short strings. Larger strings appears to work, but I don't 
have the exact size. I'm a little scared to use it if that doesn't work.

Original comment by fren...@gmail.com on 4 Dec 2013 at 4:59