zlib JavaScript implementation

概要

zlib を JavaScript に移植しました。 deflate/inflate 関数や gzip ファイル形式に対応しました。 zlib との互換性をある程度考慮しつつ、使い安さ等を考え、 JavaScript 用に API は少し修正されています。

現在、開発中なので、使い方や API は随時変更されます。 API の詳細はソースコードに記述されたコメントを参照してください。


ライセンス

Copyright (C) 2012 Masanao Izumo (JavaScript implementation)
Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler (Original implementation)

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

ダウンロード

最新版: zlib-js-0.2.0.tar.gz

アーカイブ一覧

使い方

zlib.js を最初に SRC で取り込んでください。
zlib-deflate.js は圧縮する場合に必要です。
zlib-inflate.js は圧縮する場合に必要です。
zlib-adler32.js は zlib 圧縮/展開する場合において、チェックサムを 有効にする場合に必要です。取り込まない場合はチェックサムは計算されません。
zlib-crc32.js は gzip ヘッダ付きのデータを圧縮/展開する場合において、 チェックサムを有効にする場合に必要です。 取り込まない場合はチェックサムは計算されません。
HTML の先頭に、下記の用に必要な感じでモジュールを取り込みます。
<SCRIPT LANGUAGE="JavaScript" SRC="zlib.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="zlib-deflate.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="zlib-inflate.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="zlib-adler32.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="zlib-crc32.js"></SCRIPT>
inflate/deflate の使い方は deflate.js/inflate.js 内のコメントを参照 して下さい。

開発状況

2012/4/12 現在
[email protected]