客户端数据压缩/解压缩? [英] Client side data compress/decompress?

查看:139
本文介绍了客户端数据压缩/解压缩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个字符串压缩/解压缩算法的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.

我阅读了关于 gzip ,但它压缩数据服务器端,而在我的情况下,我想压缩它的客户端,

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.

我发现这个 LZF压缩示例,它基于 LZFjs ,但会生成

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:
https://github.com/pierrec/node-lz4

There is this open-source Javascript compression library, by Pierre curto : https://github.com/pierrec/node-lz4

Googling,我也发现这个zlib实现(不是由我测试):
http://nodejs.org/api/zlib.html

Googling around, I also found this zlib implementation (not tested by me) : http://nodejs.org/api/zlib.html

这篇关于客户端数据压缩/解压缩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆