Git Product home page Git Product logo

js-deflate's People

Contributors

dankogai avatar esarbe avatar jbt 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-deflate's Issues

Doesn't work out of the box (missing base64.js)

You should include the base64.js from your base64 repo in this repo, as it is referenced in the HTML test file.

Another js file is included which I couldn't find, but just removing the script tag fixed the problem.

Also, we tested with pretty large samples (compressing a 700K text file) and the keyup handling wasn't so nice (long delays, have to type an extra key after pasting the content). Explicit buttons for compress/decompress would be nice for testing with large datasets.

Great lib!

Invalid deflate

Hi,

It seems that you don't respect totally the RFC. For example if I deflate "octavian" using zlib (with DEFLATE_OPTION) I obtain the following bytes:

120 156 203 79 46 73 44 203 76 204 3 0 15 21 3 86

If I deflate the same string using your library I obtain the following bytes:
203 79 46 73 44 203 76 204 3 9 0

So, I can't deflate a string using your library and inflating using another software.

can't get any other compression library to recognize this format

Using python:

import zlib
zlib.decompress("w7NIw43DicOJBwA=".decode("base64"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
zlib.error: Error -3 while decompressing data: incorrect header check

using node.js:

> zlib.inflateSync(new Buffer("w7NIw43DicOJBwA=", "base64"))
Error: incorrect header check
...
> zlib.inflateRawSync(new Buffer("w7NIw43DicOJBwA=", "base64"))
Error: invalid distance too far back
...
> zlib.gunzipSync(new Buffer("w7NIw43DicOJBwA=", "base64"))
Error: incorrect header check
...

But I can get python's compressed blobs to be accepted by node's inflateSync. (And I have experience using python for png formatting, and node for zip file formatting.)

Is this project compliant with the DEFLATE spec?

Licence

Can you please license js-deflate with a BSD, MIT licence so everyone can use it. I would like to use it in a commercial product.

Thanks!

Gene Thomas.

Compatible Java library

An interesting usage for this library is sending compressed data from a javascript client to a Java-based server, decoding the data on the server. For example, compress some json parameters sent via an Ajax request.
To check this option, I created a deflated+base64 encoded string using this library, and tried inflating it using the Java package java.util.zip (Classes Deflater and Inflater). Unfortunately I bumped into problems due to incompatibility of javascript escape/unescape with Java.
Is there a compatible Java library that can work with this javascript implementation?
Regards

huffman code error

Tested below code. Input string is part of genjimonogatari(HTML, Shift JIS). Decoding is failed.
a=RawDeflate.deflate(String.fromCharCode.apply(0,[60,72,84,77,76,62,10,60,72,69,65,68,62,10,60,84,73,84,76,69,62,137,212,142,85,151,162,129,105,146,232,137,198,142,169,149,77,150,123,129,106,60,47,84,73,84,76,69,62,10,60,47,72,69,65,68,62,10,60,66,79,68,89,62,10,70,105,114,115,116,32,117,112,100,97,116,101,100,32,57,47,50,48,47,49,57,57,54,129,105,118,101,114,46,49,45,49,129,106,60,66,82,62,32,10,76,97,115,116,32,117,112,100,97,116,101,100,32,57,47,54,47,50,48,48,57,129,105,118,101,114,46,50,45,50,129,106,60,66,82,62,10,143,97,146,74,137,104,136,234,141,90,146,249,40,67,41,60,66,82,62,10,60,80,62,10,129,64,129,64,60,72,51,62,137,212,142,85,151,162,60,47,72,51,62,10,60,80,62,10,140,245,130,233,140,185,142,129,130,204,147,241,143,92,140,220,141,206,137,196,129,65,139,223,137,113,145,229,143,171,142,158,145,227,130,204,149,168,140,234,60,66,82,62,10,60,80,62,10,129,64,137,212,142,85,151,162,130,204,149,168,140,234,60,66,82,62,10,60,66,82,62,10,129,64,91,142,229,151,118,147,111,143,234,144,108,149,168,93,60,66,82,62,10,60,68,76,62,10,60,68,84,62,129,64,140,245,130,233,140,185,142,129,60,130,208,130,169,130,233,130,176,130,241,130,182,62,10,60,68,68,62,140,196,143,204,45,45,45,145,229,143,171,147,97,129,65,147,241,143,92,140,220,141,206,129,64,142,81,139,99,140,147,139,223,137,113,137,69,145,229,143,171,60,66,82,62,10,60,68,84,62,129,64,137,212,142,85,151,162,60,130,205,130,200,130,191,130,233,130,179,130,198,62,10,60,68,68,62,140,196,143,204,45,45,45,142,79,130,204,140,78,129,65,151,237,140,105,147,97,143,151,140,228,130,204,150,133,129,64,140,185,142,129,130,204,151,246,144,108,60,66,82,62,10,60,68,84,62,129,64,151,237,140,105,147,97,143,151,140,228,60,130,234,130,162,130,175,130,162,130,197,130,241,130,204,130,201,130,229,130,164,130,178,62,10,60,68,68,62,140,196,143,204,45,45,45,151,237,140,105,147,97,129,69,143,151,140,228,129,65,140,204,139,203,154,226,137,64,130,204,143,151,140,228,60,66,82,62,10,60,68,84,62,129,64,136,210,140,245,60,130,177,130,234,130,221,130,194,62,10,60,68,68,62,140,196,143,204,45,45,45,136,210,140,245,129,65,140,185,142,129,130,204,147,251,149,234,142,113,60,66,82,62,10,60,47,68,76,62,10,60,80,62,10,60,79,76,62,10,60,76,73,62,137,212,142,85,151,162,150,75,150,226,130,240,140,136,136,211,45,45,45,60,65,32,72,82,69,70,61,34,35,105,110,49,49,34,62,144,108,146,109,130,234,130,202,129,65,140,228,144,83,130,195,130,169,130,231,130,204,130,224,130,204,142,118,130,205,130,181,130,179,130,205,60,47,65,62,10,60,76,73,62,146,134,144,236,130,204,143,151,130,198,152,97,137,204,130,240,145,161,147,154,45,45,45,60,65,32,72,82,69,70,61,34,35,105,110,49,50,34,62,137,189,130,206,130,169,130,232,130,204,140,228,130,230,130,187,130,208,130,200,130,173,129,65,130,164,130,191,130,226,130,194,130,181,130,196,60,47,65,62,10,60,76,73,62,142,111,151,237,140,105,147,97,143,151,140,228,130,198,144,204,130,240,140,234,130,233,45,45,45,60,65,32,72,82,69,70,61,34,35,105,110,49,51,34,62,130,169,130,204,150,123,136,211,130,204,143,138,130,205,129,65,142,118,130,181,130,226,130,232,130,194,130,233,130,224,130,181,130,233,130,173,60,47,65,62,10,60,76,73,62,137,212,142,85,151,162,130,240,150,75,150,226,45,45,45,60,65,32,72,82,69,70,61,34,35,105,110,49,52,34,62,144,188,150,202,130,201,130,205,129,65,130,237,130,180,130,198,130,200,130,173,60,47,65,62,10,60,47,79,76,62,10,60,80,62,10,60,65,32,72,82,69,70,61,34,35,105,110,50,49,34,62,129,121,143,111,147,84,129,122,60,47,65,62,60,66,82,62,10,60,65,32,72,82,69,70,61,34,35,105,110,50,50,34,62,129,121,141,90,146,249,129,122,60,47,65,62,60,66,82,62,10,60,80,62,10,129,64,60,72,52,62,137,212,142,85,151,162,130,204,149,168,140,234,60,47,72,52,62,10,129,64,60,65,32,78,65,77,69,61,34,105,110,49,49,34,62,91,145,230,136,234,146,105,129,64,137,212,142,85,151,162,150,75,150,226,130,240,140,136,136,211,93,60,47,65,62,60,66,82,62,10,60,80,62,10,129,64,144,108,146,109,130,234,130,202,129,65,140,228,144,83,130,195,130,169,130,231,130,204,130,224,130,204,142,118,130,205,130,181,130,179,130,205,129,65,130,162,130,194,130,198,130,200,130,171,130,177,130,198,60,65,32,72,82,69,70,61,34,35,107,48,49,34,62,130,200,130,223,130,234,130,199,60,47,65,62,60,65,32,78,65,77,69,61,34,116,48,49,34,62,129,65,60,47,65,62,130,169,130,173,130,168,130,217,130,169,130,189,130,204,144,162,130,201,130,194,130,175,130,196,130,179,130,214,129,65,130,237,130,195,130,231,130,205,130,181,130,164,142,118,130,181,151,144,130,233,130,233,130,177,130,198,130,204,130,221,130,220,130,179,130,234,130,206,129,65,130,224,130,204,144,83,141,215,130,173,129,65,144,162,130,204,146,134,130,200,130,215,130,196,137,125,130,205,130,181,130,164,142,118,130,181,130,200,130,231,130,233,130,233,130,201,129,65,130,179,130,183,130,170,130,200,130,233,130,177,130,198,145,189,130,169,130,232,129,66,60,66,82,62,10,60,80,62,10,129,64,151,237,140,105,147,97,130,198,149,183,130,177,130,166,130,181,130,205,129,65,139,123,130,189,130,191,130,224,130,168,130,205,130,185,130,184,129,65,137,64,137,66,130,234,130,179,130,185,130,189,130,220,130,208,130,196,140,227,129,65,130,162,130,230,130,162,130,230,130,160,130,205,130,234,130,200,130,233,140,228,130,160,130,232,130,179,130,220,130,240,129,65,130,189,130,190,130,177,130,204,145,229,143,171,147,97,130,204,140,228,144,83,130,201,130,224,130,196,137,66,130,179,130,234,130,196,129,65,137,223,130,174,130,181,130,189,130,220,130,211,130,200,130,233,130,215,130,181,129,66,60,66,82,62,10,60,80,62,10,129,64,140,228,130,168,130,198,130,164,130,198,130,204,142,79,130,204,140,78,129,65,147,224,151,160,130,237,130,189,130,232,130,201,130,196,130,205,130,169,130,200,130,164,130,217,130,204,130,223,130,171,130,189,130,220,130,208,130,181,130,200,130,178,130,232,130,204,129,65,151,225,130,204,140,228,144,83,130,200,130,234,130,206,129,65,130,179,130,183,130,170,130,201,150,89,130,234,130,224,137,202,130,196,130,189,130,220,130,205,130,184,129,65,130,237,130,180,130,198,130,224,130,224,130,196,130,200,130,181,130,189,130,220,130,205,130,202,130,201,129,65,144,108,130,204,140,228,144,83,130,240,130,204,130,221,144,115,130,173,130,181,137,202,130,196,130,189,130,220,130,211,130,215,130,169,130,223,130,233,130,240,130,224,129,65,130,177,130,204,130,178,130,235,142,99,130,233,130,177,130,198,130,200,130,173,142,118,130,181,151,144,130,233,130,233,144,162,130,204,130,160,130,205,130,234,130,204,130,173,130,179,130,205,130,208,130,201,130,205,129,65,142,118,130,208,143,111,130,197,130,189,130,220,130,211,130,201,130,205,129,65,148,69,130,209,130,170,130,189,130,173,130,196,129,65,140,220,140,142,137,74,130,204,139,243,130,223,130,195,130,231,130,181,130,173,144,176,130,234,130,189,130,233,137,95,138,212,130,201,147,110,130,232,130,189,130,220,130,211,129,66,60,66,82,62,10,60,80,62,10,129,64,60,65,32,78,65,77,69,61,34,105,110,49,50,34,62,91,145,230,147,241,146,105,129,64,146,134,144,236,130,204,143,151,130,198,152,97,137,204,130,240,145,161,147,154,93,60,47,65,62,60,66,82,62,10,60,80,62,10,129,64,137,189,130,206,130,169,130,232,130,204,140,228,130,230,130,187,130,208,130,200,130,173,129,65,130,164,130,191,130,226,130,194,130,181,130,196,129,65,140,228,145,79,130,200,130,199,130,224,130,200,130,173,129,65,148,69,130,209,130,196,129,65,146,134,144,236,130,204,130,217,130,199,130,168,130,205,130,181,137,223,130,174,130,233,130,201,129,65,130,179,130,179,130,226,130,169,130,200,130,233,137,198,130,204,129,65,150,216,151,167,130,200,130,199,130,230,130,181,130,206,130,223,130,233,130,201,129,65,130,230,130,173,150,194,130,233,139,213,130,240,129,65,130,160,130,195,130,220,130,201,146,178,130,215,130,196,129,65,145,126,130,171,141,135,130,205,130,185,129,65,130,201,130,172,130,205,130,205,130,181,130,173,146,101,130,171,130,200,130,183,130,200,130,232,129,66,60,66,82,62,10,60,80,62,10,129,64,140,228,142,168,130,198,130,220,130,232,130,196,129,65,150,229,139,223,130,200,130,233,143,138,130,200,130,234,130,206,129,65,130,183,130,177,130,181,130,179,130,181,143,111,130,197,130,196,140,169,147,252,130,234,130,189,130,220,130,214,130,206,129,65,145,229,130,171,130,200,130,233,140,106,130,204,150,216,130,204,146,199,130,208,149,151,130,201,129,65,141,213,130,204,130,177,130,235,142,118,130,181,143,111,130,197,130,231,130,234,130,196,129,65,130,187,130,177,130,205,130,169,130,198,130,200,130,173,130,175,130,205,130,208,130,240,130,169,130,181,130,171,130,240,129,65,129,117,130,189,130,190,136,234,150,218,140,169,130,189,130,220,130,208,130,181,143,104,130,232,130,200,130,232,129,118,130,198,140,169,130,189,130,220,130,211,129,66,130,189,130,190,130,200,130,231,130,184,129,65,129,117,130,217,130,199,140,111,130,201,130,175,130,233,129,65,130,168,130,218,130,223,130,169,130,181,130,173,130,226,129,118,130,198,129,65,130,194,130,194,130,220,130,181,130,175,130,234,130,199,129,65,60,65,32,72,82,69,70,61,34,35,110,111,49,34,62,137,223,130,172,130,170,130,196,130,201,60,47,65,62,60,65,32,78,65,77,69,61,34,116,101,49,34,62,130,226,60,47,65,62,130,183,130,231,130,208,130,189,130,220,130,211,129,65,144,220,130,181,130,224,129,65,130,217,130,198,130,198,130,172,130,183,150,194,130,171,130,196,147,110,130,233,129,66,130,224,130,230,130,217,130,181,130,171,130,177,130,166,138,231,130,200,130,234,130,206,129,65,140,228,142,212,130,168,130,181,149,212,130,179,130,185,130,196,129,65,151,225,130,204,129,65,136,210,140,245,147,252,130,234,130,189,130,220,130,211,129,66,60,66,82,62,10,60,80,62,10,129,64,129,117,130,240,130,191,130,169,130,214,130,232,130,166,130,188,148,69,130,206,130,234,130,202,130,217,130,198,130,198,130,172,130,183,60,66,82,62,10,129,64,129,64,130,217,130,204,140,234,130,231,130,208,130,181,143,104,130,204,138,95,141,170,130,201,129,118,60,66,82,62,10,60,80,62,10,129,64,144,81,147,97,130,198,130,168,130,218,130,181,130,171,137,174,130,204,144,188,130,204,141,200,130,201,144,108,130,209,130,198,130,238,130,189,130,232,129,66,144,230,129,88,130,224,149,183,130,171,130,181,144,186,130,200,130,234,130,206,129,65,144,186,130,195,130,173,130,232,130,175,130,181,130,171,130,198,130,232,130,196,129,65,140,228,143,193,145,167,149,183,130,177,130,228,129,66,142,225,130,226,130,169,130,200,130,233,130,175,130,181,130,171,130,199,130,224,130,181,130,196,129,65,130,168,130,218,130,223,130,173,130,200,130,233,130,215,130,181,129,66,60,66,82,62,10,60,80,62,10,129,64,129,117,130,217,130,198,130,198,130,172,130,183,140,190,150,226,130,211,144,186,130,205,130,187,130,234,130,200,130,234,130,199,60,66,82,62,10,129,64,129,64,130,160,130,200,130,168,130,218,130,194,130,169,130,200,140,220,140,142,137,74,130,204,139,243,129,118,60,66,82,62,10,60,80,62,10,129,64,130,177,130,198,130,179,130,231,130,189,130,199,130,233,130,198,140,169,130,234,130,206,129,65,60,66,82,62,10,129,64,129,117,130,230,130,181,130,230,130,181,129,65,60,65,32,72,82,69,70,61,34,35,110,111,50,34,62,144,65,130,239,130,181,138,95,141,170,130,224,60,47,65,62,60,65,32,78,65,77,69,61,34,116,101,50,34,62,129,118,60,47,65,62,60,66,82,62,10,129,64,130,198,130,196,143,111,130,195,130,233,130,240,129,65,144,108,146,109,130,234,130,202,144,83,130,201,130,205,129,65,130,203,130,189,130,164,130,224,130,160,130,205,130,234,130,201,130,224,142,118,130,208,130,175,130,232,129,66,60,66,82,62,10,129,64,129,117,130,179,130,224,129,65,130,194,130,194,130,222,130,215,130,171,130,177,130,198,130,188,130,169,130,181,129,66,130,177,130,198,130,237,130,232,130,201,130,224,130,160,130,234,130,206,129,65,130,179,130,183,130,170,130,200,130,232,129,66,130,169,130,226,130,164,130,204,141,219,130,201,129,65,146,125,142,135,130,204,140,220,144,223,130,170,129,65,130,231,130,164,130,189,130,176,130,200,130,232,130,181,130,205,130,226,129,118,60,66,82,62,10,129,64,130,198,129,65,130,220,130,195,142,118,130,181,143,111,130,195,129,66,60,66,82,62,10,60,80,62,10,129,64,130,162,130,169,130,200,130,233,130,201,130,194,130,175,130,196,130,224,129,65,140,228,144,83,130,204,137,201,130,200,130,173,139,234,130,181,130,176,130,200,130,232,129,66,148,78,140,142,130,240,140,111,130,196,130,224,129,65,130,200,130,217,130,169,130,226,130,164,130,201,129,65,140,169,130,181,130,160,130,189,130,232,129,65,143,238,130,175,137,223,130,174,130,181,130,189,130,220,130,205,130,202,130,201,130,181,130,224,129,65,130,200,130,169,130,200,130,169,129,65,130,160,130,220,130,189,130,204,144,108,130,204,130,224,130,204,142,118,130,208,130,174,130,179,130,200,130,232,129,66,60,66,82,62,10,60,80,62,10,129,64,60,65,32,78,65,77,69,61,34,105,110,49,51,34,62,91,145,230,142,79,146,105,129,64,142,111,151,237,140,105,147,97,143,151,140,228,130,198,144,204,130,240,140,234,130,233,93,60,47,65,62,60,66,82,62,10,60,80,62,10,129,64,130,169,130,204,150,123,136,211,130,204,143,138,130,205,129,65,142,118,130,181,130,226,130,232,130,194,130,233,130,224,130,181,130,233,130,173,129,65,144,108,150,218,130,200,130,173,129,65,144,195,130,169,130,201,130,196,130,168,130,205,130,183,130,233,130,160,130,232,130,179,130,220,130,240,140,169,130,189,130,220,130,211,130,224,129,65,130,162,130,198,130,160,130,205,130,234,130,200,130,232,129,66,130,220,130,195,129,65,143,151,140,228,130,204,140,228,149,251,130,201,130,196,129,65,144,204,130,204,140,228,149,168,140,234,130,200,130,199,149,183,130,177,130,166,130,189,130,220,130,211,130,201,129,65,150,233,141,88,130,175,130,201,130,175,130,232,129,66,60,66,82,62,10,129,64,147,241,143,92,147,250,130,204,140,142,130,179,130,181,143,111,130,195,130,233,130,217,130,199,130,201,129,65,130,162,130,198,130,199,150,216,141,130,130,171,136,252,130,199,130,224,150,216,136,195,130,173,140,169,130,166,130,237,130,189,130,232,130,196,129,65,139,223,130,171,139,107,130,204,140,79,130,232,130,200,130,194,130,169,130,181,130,173,147,245,130,208,130,196,129,65,143,151,140,228,130,204,140,228,130,175,130,205,130,208,129,65,130,203,130,209,130,201,130,189,130,234,130,199,129,65,130,160,130,173,130,220,130,197,151,112,136,211,130,160,130,232,129,65,130,160,130,196,130,201,130,231,130,164,130,189,130,176,130,200,130,232,129,66,60,66,82,62,10,60,80,62,10,129,64,129,117,130,183,130,174,130,234,130,196,130,205,130,200,130,226,130,169,130,200,130,233,140,228,130,168,130,218,130,166,130,177,130,187,130,200,130,169,130,232,130,181,130,169,130,199,129,65,130,222,130,194,130,220,130,181,130,164,130,200,130,194,130,169,130,181,130,171,149,251,130,201,130,205,142,118,130,181,130,189,130,232,130,181,130,224,130,204,130,240,129,118,60,66,82,62,10,129,64,130,200,130,199,129,65,142,118,130,208,143,111,130,197,130,171,130,177,130,166,130,189,130,220,130,211,130,201,130,194,130,175,130,196,130,224,129,65,144,204,130,204,130,177,130,198,130,169,130,171,130,194,130,231,130,203,142,118,130,179,130,234,130,196,129,65,130,164,130,191,139,131,130,171,130,189,130,220,130,211,129,66,60,66,82,62,10,60,80,62,10,129,64,130,217,130,198,130,198,130,172,130,183,129,65,130,160,130,232,130,194,130,233,138,95,141,170,130,204,130,201,130,226,129,65,147,175,130,182,144,186,130,201,130,164,130,191,150,194,130,173,129,66,129,117,149,231,130,208,151,136,130,201,130,175,130,233,130,230,129,118,130,198,129,65,142,118,130,179,130,233,130,233,130,217,130,199,130,224,129,65,137,144,130,200,130,232,130,169,130,181,129,66,129,117,60,65,32,72,82,69,70,61,34,35,110,111,51,34,62,130,162,130,169,130,201,146,109,130,232,130,196,130,169,60,47,65,62,60,65,32,78,65,77,69,61,34,116,101,51,34,62,129,118,60,47,65,62,130,200,130,199,129,65,148,69,130,209,130,226,130,169,130,201,130,164,130,191,230,117,130,241,130,182,130,189,130,220,130,211,129,66,60,66,82,62,10,60,80,62,10,129,64,129,117,60,65,32,72,82,69,70,61,34,35,110,111,52,34,62,139,107,130,204,141,129,130,240,130,200,130,194,130,169,130,181,130,221,130,217,130,198,130,198,130,172,130,183,60,66,82,62,10,129,64,129,64,137,212,142,85,130,233,151,162,130,240,130,189,130,195,130,203,130,196,130,188,130,198,130,211,60,47,65,62,60,65,32,78,65,77,69,61,34,116,101,52,34,62,60,66,82,62,10,60,80,62,10,129,64,130,162,60,47,65,62,130,201,130,181,130,214,130,204,150,89,130,234,130,170,130,189,130,171,136,212,130,223,130,201,130,205,129,65,130,200,130,217,142,81,130,232,130,205,130,215,130,232,130,202,130,215,130,169,130,232,130,175,130,232,129,66,130,177,130,230,130,200,130,164,130,177,130,187,129,65,149,180,130,233,130,233,130,177,130,198,130,224,129,65,144,148,147,89,130,211,130,177,130,198,130,224,130,205,130,215,130,232,130,175,130,234,129,66,130,168,130,217,130,169,130,189,130,204,144,162,130,201,143,93,130,211,130,224,130,204,130,200,130,234,130,206,129,65,144,204,140,234,130,224,130,169,130,171,130,173,130,195,130,183,130,215,130,171,144,108,143,173,130,200,130,164,130,200,130,232,130,228,130,173,130,240,129,65,130,220,130,181,130,196,129,65,130,194,130,234,130,195,130,234,130,224,149,180,130,234,130,200,130,173,142,118,130,179,130,233,130,231,130,222,129,118,60,66,82,62,10,60,80,62,10,129,64,130,198,149,183,130,177,130,166,130,189,130,220,130,211,130,201,129,65,130,162,130,198,130,179,130,231,130,200,130,233,144,162,130,200,130,234,130,199,129,65,130,224,130,204,130,240,130,162,130,198,130,160,130,205,130,234,130,201,142,118,130,181,145,177,130,175,130,189,130,233,140,228,130,175,130,181,130,171,130,204,144,243,130,169,130,231,130,202,130,224,129,65,144,108,130,204,140,228,130,179,130,220,130,169,130,231,130,201,130,226,129,65,145,189,130,173,130,160,130,205,130,234,130,188,147,89,130,208,130,201,130,175,130,233,129,66,60,66,82,62,10,60,80,62,10,129,64,129,117,144,108,150,218,130,200,130,173,141,114,130,234,130,189,130,233,143,104,130,205,139,107,130,204,60,66,82,62,10,129,64,129,64,137,212,130,177,130,187,140,172,130,204,130,194,130,220,130,198,130,200,130,232,130,175,130,234,129,118,60,66,82,62,10,60,80,62,10,129,64,130,198,130,206,130,169,130,232,130,204,130,189,130,220,130,214,130,233,129,65,129,117,130,179,130,205,130,162,130,214,130,199,129,65,144,108,130,201,130,205,130,162,130,198,130,177,130,198,130,200,130,232,130,175,130,232,129,118,130,198,129,65,142,118,130,181,148,228,130,215,130,231,130,233,129,66,60,66,82,62,10,60,80,62,10,129,64,60,65,32,78,65,77,69,61,34,105,110,49,52,34,62,91,145,230,142,108,146,105,129,64,137,212,142,85,151,162,130,240,150,75,150,226,93,60,47,65,62,60,66,82,62,10,60,80,62,10,129,64,144,188,150,202,130,201,130,205,129,65,130,237,130,180,130,198,130,200,130,173,129,65,148,69,130,209,130,226,130,169,130,201,130,164,130,191,144,85,130,233,149,145,130,208,130,189,130,220,130,208,130,196,129,65,148,96,130,171,130,189,130,220,130,214,130,233,130,224,129,65,130,223,130,195,130,231,130,181,130,171,130,201,147,89,130,214,130,196,129,65,144,162,130,201,150,218,130,200,130,234,130,202,140,228,130,179,130,220,130,200,130,234,130,206,129,65,130,194,130,231,130,179,130,224,150,89,130,234,130,202,130,215,130,181,129,66,137,189,130,226,130,169,130,226,130,198,129,65,151,225,130,204,129,65,130,200,130,194,130,169,130,181,130,173,140,234,130,231,130,208,130,189,130,220,130,211,130,224,129,65,142,118,130,179,130,202,130,177,130,198,130,201,130,160,130,231,130,180,130,233,130,215,130,181,129,66,60,66,82,62,10,60,80,62,10,129,64,130,169,130,232,130,201,130,224,140,169,130,189,130,220,130,211,130,169,130,172,130,232,130,205,129,65,130,168,130,181,130,200,130,215,130,196,130,204,141,219,130,201,130,205,130,160,130,231,130,184,129,65,130,179,130,220,130,180,130,220,130,201,130,194,130,175,130,196,129,65,130,162,130,211,130,169,130,208,130,200,130,181,130,198,142,118,130,179,130,233,130,233,130,205,130,200,130,175,130,234,130,206,130,201,130,226,129,65,145,158,130,176,130,200,130,173,129,65,137,228,130,224,144,108,130,224,143,238,130,175,130,240,140,240,130,205,130,181,130,194,130,194,129,65,137,223,130,174,130,181,130,189,130,220,130,211,130,200,130,232,130,175,130,232,129,66,130,187,130,234,130,240,130,160,130,162,130,200,130,181,130,198,142,118,130,211,144,108,130,205,129,65,130,198,130,201,130,169,130,173,130,201,149,207,130,205,130,233,130,224,129,65,129,117,130,177,130,198,130,237,130,232,130,204,129,65,144,162,130,204,130,179,130,170,129,118,130,198,129,65,142,118,130,208,130,200,130,181,130,189,130,220,130,211,129,66,130,160,130,232,130,194,130,233,138,95,141,170,130,224,129,65,130,179,130,226,130,164,130,201,130,196,129,65,130,160,130,232,130,179,130,220,149,207,130,205,130,232,130,201,130,189,130,233,130,160,130,189,130,232,130,200,130,232,130,175,130,232,129,66,60,66,82,62,10,60,80,62,10,129,64,60,65,32,78,65,77,69,61,34,105,110,50,49,34,62,129,121,143,111,147,84,129,122,60,66,82,62,10,60,65,32,78,65,77,69,61,34,110,111,49,34,62,143,111,147,84,49,60,47,65,62,129,64,150,233,130,226,136,195,130,171,147,185,130,226,152,102,130,214,130,233,130,217,130,198,130,198,130,172,130,183,137,228,130,170,143,104,130,240,130,181,130,224,137,223,130,172,130,170,130,196,130,201,150,194,130,173,129,105,140,195,141,161,143,87,137,196,45,136,234,140,220,142,108,129,64,139,73,151,70,145,165,129,106,60,65,32,72,82,69,70,61,34,35,116,101,49,34,62,129,105,150,223,129,106,60,47,65,62,60,66,82,62,10,60,65,32,78,65,77,69,61,34,110,111,50,34,62,143,111,147,84,50,60,47,65,62,129,64,136,205,130,205,130,203,130,199,150,72,130,204,226,223,137,196,151,136,130,234,130,206,144,65,130,239,130,181,138,95,141,170,130,224,150,206,130,232,130,160,130,208,130,175,130,232,129,105,143,111,147,84,150,162,143,218,45,140,185,142,129,142,223,143,138,136,248,129,106,60,65,32,72,82,69,70,61,34,35,116,101,50,34,62,129,105,150,223,129,106,60,47,65,62,60,66,82,62,10,60,65,32,78,65,77,69,61,34,110,111,51,34,62,143,111,147,84,51,60,47,65,62,129,64,130,162,130,201,130,181,130,214,130,204,130,177,130,198,140,234,130,231,130,214,130,206,130,217,130,198,130,198,130,172,130,183,130,162,130,169,130,201,146,109,130,232,130,196,130,169,140,195,144,186,130,204,130,183,130,233,129,105,140,195,141,161,152,90,146,159,140,220,45,147,241,148,170,129,90,142,108,129,106,60,65,32,72,82,69,70,61,34,35,116,101,51,34,62,129,105,150,223,129,106,60,47,65,62,60,66,82,62,10,60,65,32,78,65,77,69,61,34,110,111,52,34,62,143,111,147,84,52,60,47,65,62,129,64,140,220,140,142,145,210,130,194,137,212,139,107,130,204,141,129,130,240,130,169,130,176,130,206,144,204,130,204,144,108,130,204,145,179,130,204,141,129,130,188,130,183,130,233,129,105,140,195,141,161,143,87,137,196,45,136,234,142,79,139,227,129,64,147,199,144,108,130,181,130,231,130,184,129,106,139,107,130,204,137,212,142,85,130,233,151,162,130,204,130,217,130,198,130,198,130,172,130,183,149,208,151,246,130,181,130,194,130,194,150,194,130,173,147,250,130,181,130,188,145,189,130,171,129,105,150,156,151,116,143,87,138,170,148,170,45,136,234,142,108,142,181,142,181,129,64,145,229,148,186,151,183,144,108,129,106,60,65,32,72,82,69,70,61,34,35,116,101,52,34,62,129,105,150,223,129,106,60,47,65,62,60,66,82,62,10,60,80,62,10,129,64,60,65,32,78,65,77,69,61,34,105,110,50,50,34,62,129,121,141,90,146,249,129,122,60,66,82,62,10,148,245,141,108,45,45,129,105,47,129,106,129,64,131,126,131,90,131,80,131,96,45,45,129,144,129,64,150,149,143,193,45,45,129,148,129,64,149,226,147,252,45,45,43,129,64,150,84,143,145,45,45,61,129,64,131,105,131,93,131,138,143,100,130,203,45,45,129,149,129,64,147,198,142,169,136,217,149,182,147,153,45,45,42,129,64,142,233,149,77,45,45,60,142,233,62,129,64,149,115,150,190,45,45,129,162,60,66,82,62,10,60,65,32,78,65,77,69,61,34,107,48,49,34,62,141,90,146,249,49,60,47,65,62,129,64,130,200,130,223,130,234,130,199,45,45,130,200,129,105,130,200,47,43,130,223,129,106,130,234,130,198,60,65,32,72,82,69,70,61,34,35,116,48,49,34,62,129,105,150,223,129,106,60,47,65,62,60,66,82,62,10,60,80,62,10,60,65,32,72,82,69,70,61,34,105,110,100,101,120,46,104,116,109,108,34,62,140,185,142,129,149,168,140,234,130,204,144,162,138,69,131,119,60,47,65,62,60,66,82,62,10,60,65,32,72,82,69,70,61,34,114,111,109,97,110,49,49,46,104,116,109,108,34,62,131,141,129,91,131,125,142,154,148,197,32,60,47,65,62,60,66,82,62,10,60,65,32,72,82,69,70,61,34,118,101,114,115,105,111,110,49,49,46,104,116,109,108,34,62,140,187,145,227,140,234,150,243,32,60,47,65,62,60,66,82,62,10,60,65,32,72,82,69,70,61,34,110,111,116,101,49,49,46,104,116,109,108,34,62,146,141,142,223,60,47,65,62,60,66,82,62,10,60,65,32,72,82,69,70,61,34,100,97,116,97,49,49,49,46,104,116,109,108,34,62,146,232,137,198,142,169,149,77,150,123,60,47,65,62,60,66,82,62,10,60,65,32,72,82,69,70,61,34,100,97,116,97,49,49,50,46,104,116,109,108,34,62,145,229,147,135,150,123,60,47,65,62,60,66,82,62,10,60,65,32,72,82,69,70,61,34,111,107,117,105,114,105,49,49,46,104,116,109,108,34,62,142,169,149,77,150,123,137,156,147,252,60,47,65,62,60,66,82,62,10,60,47,66,79,68,89,62,10,60,72,82,32,83,73,90,69,61,52,62,10,60,47,72,84,77,76,62]))

Invalid inflate

HI,
I deflated under string:

{"WorkID":"634828917904197752","StartTime":"2013-07-09 11:31:41","QuesList":[{"ID":"634898719662752272","Sorce":5,"Type":1,"Answers":[{"SID":1,"Ans":"609652639572752273"}]},{"ID":"634898719632602263","Sorce":5,"Type":1,"Answers":[{"SID":1,"Ans":"609652639572602264"}]},{"ID":"634898718910413816","Sorce":5,"Type":1,"Answers":[{"SID":1,"Ans":"609652638900413817"}]},{"ID":"634898718178469664","Sorce":5,"Type":1,"Answers":[{"SID":1,"Ans":"609652638128469665"}]},{"ID":"634898717935986938","Sorce":5,"Type":1,"Answers":[{"SID":1,"Ans":"609652637905986939"}]},{"ID":"634898716539937661","Sorce":5,"Type":1,"Answers":[{"SID":1,"Ans":"609652636519937662"}]},{"ID":"634898716503703300","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":"口服后房价"}]},{"ID":"634898715706999447","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":"飞"}]},{"ID":"634898713482038183","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":""}]},{"ID":"634898713210804385","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":"发的"}]},{"ID":"634898709742857746","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":"地方"}]},{"ID":"634898707056812397","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":"大幅度"}]},{"ID":"634898719933791778","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":"的风驰电掣"}]},{"ID":"634898718855018932","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":"发的"}]},{"ID":"634898718647055321","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":"发的发的"}]},{"ID":"634898717817067277","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":""}]},{"ID":"634898717392602999","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":""}]},{"ID":"634898717338278748","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":""}]},{"ID":"634898714329531233","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":""}]},{"ID":"634898713885983003","Sorce":5,"Type":3,"Answers":[{"SID":1,"Ans":""}]}]}

the result is:
wq3DlD9rVEEQB8Oww55PIVtfYGZnd35cJ8OYBGwkAQtJIXJFEMKNw5xdEAnDlynDmHgqwojChQTCmxPDhS7CjUjCksOCL8Ojwrtww5/DgsK5e2DDo3jDsMKew6kewo/DnQ/DrMOMd8OmJMOdOxo/w5rCvcKdwobCicKpaFZDMShoIjXCp0HDmsKbPhhPw7cPH8KPw7xABsKkHcKQHcKwwpvCiEPDgmFBP3HDt3g0wrlzOMKZwqbDocO9wpPDtAcyFTTDpsOsSsKWDXQ0fsOoSB3CpMO9w6dPw70DB8Opw5bCk8OJwrPDkXjCssK5wrjCt8K+w5nDvlsLYFwzwpNVaQVKwrPCg8OZw6Avwp8yQ8O2c8O/w6NvwoQSw7leC8KvBClyX18NWkFCH0ULe8KVSm8fcyvDlMOIF8KjasOKRsOaw5fDtyjCtMKCRT5XMiNhw4bCvj5XbMKFHMO7QAJEAMKBT8Obw7zDpsONYnnDusK6eTtfwr7DusO5w6vDskfChFcBNsKzUsKkK8K+WnzCisOAw7XDtMKAd0TCozRuBUMtIygUw5LDmsO9w63Dr8KuPsK+CEwwKVnCq0jCicOywrzDnTw9W344wo9MwoHDisKeQsKyw45lbD5/bcOOXzYXX8OCw5E2w7LDsMKhSBTDncKtwqzCv33CtcKYwq/CvsKdXcK9w7/CvsKcL8OCwrnDk1rDgcKnwpvCosK9w5TCr8K2wqhcwrwUw5XDm8OWw4/DvMK3LMK+JsKAfQ92wq5wwqjCkcKtN8KeJ8O/ejTDkiwqwqVzwpsiwq1QwrZKHsKmw6vCmSBvwrPCqS/Cj17DmsOBw6zDhm8=

But i can't inflate.

please tell me why and how to do,thank you.

Invalid inflate

I'm deflating following html using both System.IO.Compression.DeflateStream and Ionic.Zlib.DeflateStream:

<div id="feedHeaderContainer">
      <div id="feedHeader" dir="ltr" class="feedBackground">
        <div id="feedIntroText">
          <p id="feedSubscriptionInfo1"></p>
          <p id="feedSubscriptionInfo2"></p>
        </div>
        <div id="feedSubscribeLine"></div>
      </div>
    </div>

They both produce same base64 output:

s0nJLFPITLFVSktNTfFITUxJLXLOzytJzMxLLVKy4+VSAAMbTFVKCimZRbZKOSVAVnJOYnExRNIpMTk7vSi/NC8FoRtNv2deSVF+SGpFCbIKoJoCuIrg0qTi5KLMgpLM/DzPvLR8QyU7G/0CYlUboau20Qdaj8s1UN1JqT5AL4N0IqtF5kHYAA==

Decompression in C# works just fine, but using RawDeflate.inflate produces following result:

<div id="feedHeaderContainer">
      <div id="feedHeader" dir="ltr" class="feedBackground">
        <div id="feedIntroText">
          <p id="feedSbscrpass="feedBackground">
        <div id="feedIóbscrpass="feedBackground">
        <div id="feedIóbscrpass="feedBackground">
        <div id="feedIóbscrpass="feedBackground">
        <div id="feedIóbscrpass="feedBackground">
        <div id="feedIóbscrpaöscrpaöscrpaösc��NP]%�Ç��"feedBackground">
        <div id="feedIóbscrpass="feedBackground">
        <dieLedIdiv pass="feedBav pass="feedv pass

When i compress complete html document it returns empty string.

This is my code:

var com = 's0nJLFPITLFVSktNTfFITUxJLXLOzytJzMxLLVKy4+VSAAMbTFVKCimZRbZKOSVAVnJOYnExRNIpMTk7vSi/NC8FoRtNv2deSVF+SGpFCbIKoJoCuIrg0qTi5KLMgpLM/DzPvLR8QyU7G/0CYlUboau20Qdaj8s1UN1JqT5AL4N0IqtF5kHYAA==';

unc = Base64.btou(RawDeflate.inflate(Base64.fromBase64(com)));
alert(unc);

No license specified

I would like to use js-deflate in a project of mine, but unfortunately there is no license specified.

how to use it in VUE?

I tried import function or const from rawinflate.js but failed.

const RawDeflate = '../../js/compress/rawinflate'
import {zip_inflate} from '../../js/compress/rawdeflate'
// decompress from RFC1951 defalted
let plain = RawDeflate.inflate(compressed)

but it does not work. can you please show me the way?
thanks

Doesn't support level 0

I need DEFLATE support with a level 0 compression, having trouble with implementation though.

garbage added with low (fast) compression levels

Looks like zip_deflate_internal checks for zip_match_available which is never initialized in case of (zip_compr_level <= 3).
This leads to additional bytes added to compressed data in case of deflate_fast. Some picky decompressors complain about it: optipng or firefox for example.

I fixed it this way:

--- rawdeflate.js.orig  2011-09-09 19:28:45.000000000 +0200
+++ rawdeflate.js       2011-09-09 19:25:14.000000000 +0200
@@ -753,6 +753,7 @@
     zip_qhead = null;
     zip_outcnt = 0;
     zip_outoff = 0;
+    zip_match_available = 0;
 
     if(zip_compr_level <= 3)
     {
@@ -762,7 +763,6 @@
     else
     {
        zip_match_length = zip_MIN_MATCH - 1;
-       zip_match_available = 0;
     }
 
     zip_complete = false;

No License In Source

I can't find any license information, just a reference to an "original" version that also appears to also not have any explicit license (though, I do not read Japanese).

I'd really like to use this in a project, but I can't without clearer licensing.

求助

经过测试发现使用C#压缩的文本内容无法用其解压,这是为什么呢

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.