JavaScript:解压缩/ inflate / unzip / ungzip字符串 [英] JavaScript: Decompress / inflate /unzip /ungzip strings

查看:1445
本文介绍了JavaScript:解压缩/ inflate / unzip / ungzip字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找字符串膨胀算法的JavaScript实现。
我想在服务器端压缩(Java),并在客户端解压缩(JavaScript)。

I'm looking for JavaScript implementation of string inflating algorithms. I want to compress on the server side (Java), and decompress on the client side (JavaScript).

我发现:

在javascript中解压缩字符串

那个被标记为已回答并回答了不同的问题。其他答案也适用于其他内容(以ZIP格式解压缩文件)。

unzip strings in javascript
That one is marked as answered with an answer for different problem. Other answers are also for something else (unzipping files in ZIP format).

JavaScript膨胀实现(可能只有FF 3.6)

这最接近我的需要。但是我想有一些替代方案。

JavaScript inflate implementation (possibly FF 3.6 only)
This is closest to what I need. However I'd like to have some alternatives.

建议?

谢谢,Ondra

Suggestions?
Thanks, Ondra

更新:
我有一个特定的用例,请不要回答不要在JavaScript中这样做。
我正在编写一个离线报告工具(一旦生成,它被放到一个静态存储中)并且放气可能会为单个报告节省数兆字节。我受其他应用程序的约束,因此我无法将其存储为zip文件。

Update: I have quite a specific use case, please don't answer "Don't do that in JavaScript." I am writing an "offline" reporting tool (once generated, it's put to a static store) and deflating may save megabytes for a single report. I am constrained by other apps so I can't store it as a zip file.

推荐答案

看看此Stack Overflow问题,其中的答案包含对javascript中实现的多个压缩引擎的引用。其中大部分都是基于LZ77。

Take a look at this Stack Overflow question, the answers there contains references to multiple compressing engines implemented in javascript. Most of these are based on LZ77.

这篇关于JavaScript:解压缩/ inflate / unzip / ungzip字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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