JavaScript DEFLATE 实现
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2233062/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JavaScript DEFLATE Implementation
提问by Eli Grey
Are there any open source DEFLATE encoder implementations for JavaScript? I need it to generate a binary format on the client-side that requires DEFLATE.
是否有任何针对 JavaScript 的开源 DEFLATE 编码器实现?我需要它在需要 DEFLATE 的客户端生成二进制格式。
采纳答案by Vitaly
I believe Pako (https://github.com/nodeca/pako) is now the fastest javascript implementation of deflate and other zlib methods (inflate / gzip / ungzip). There are benchmarks on the github page. It also supports chunking if you need to work with big blobs.
我相信 Pako ( https://github.com/nodeca/pako) 现在是 deflate 和其他 zlib 方法 (inflate / gzip / ungzip) 最快的 javascript 实现。github页面上有基准测试。如果您需要处理大 blob,它还支持分块。
Disclaimer: I am the author of this code.
免责声明:我是此代码的作者。
回答by Eli Grey
I found a DEFLATE encoder and decoder implementation at http://github.com/dankogai/js-deflateand they both work perfectly.
我在http://github.com/dankogai/js-deflate找到了一个 DEFLATE 编码器和解码器实现,它们都运行良好。

