问题描述
我正在寻找一个字符串压缩/解压缩算法的JavaScript实现,其中数据在客户端创建并存储在HTML表单中的隐藏字段中。
I'm looking for a JavaScript implementation of a string compress/decompress algorithm where data is created at the client side and stored in hidden fields within HTML forms.
我阅读了关于,但它压缩数据服务器端,而在我的情况下,我想压缩它的客户端,
I read about gzip, but it compresses the data server side whereas in my case I want to compress it client side, send it to the server, or receive it from server to decompress it again at client side.
我发现这个示例,它基于,但会生成
I found this LZF Compression example based on LZFjs but it will generate binary data which needs to be processed and stored in a hidden form field, and it works on files rather than pure data.
有关纯数据客户端数据压缩的建议/解压缩也很有效?
Suggestions on a pure data client-side data compression/decompression that is also efficient?
推荐答案
有一个开源的Javascript压缩库,由Pierre curto:
There is this open-source Javascript compression library, by Pierre curto :https://github.com/pierrec/node-lz4
Googling,我也发现这个zlib实现(不是由我测试):
Googling around, I also found this zlib implementation (not tested by me) :http://nodejs.org/api/zlib.html
这篇关于客户端数据压缩/解压缩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!