RFC1950 日本語訳
1950 ZLIB Compressed Data Format Specification version 3.3. P.Deutsch, J-L. Gailly. May 1996. (Format: TXT=20502, PS=37768, PDF=36393 bytes) (Status: INFORMATIONAL)
プログラムでの自動翻訳です。
英語原文
Network Working Group P. Deutsch Request for Comments: 1950 Aladdin Enterprises Category: Informational J-L. Gailly Info-ZIP May 1996
コメントを求めるワーキンググループP.ドイツ語要求をネットワークでつないでください: 1950年のアラジンエンタープライズカテゴリ: 情報のJ-L。 ゲイルインフォメーションファスナ1996年5月
ZLIB Compressed Data Format Specification version 3.3
ZLIB Compressed Data Format Specificationバージョン3.3
Status of This Memo
このメモの状態
This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind. Distribution of this memo is unlimited.
このメモはインターネットコミュニティのための情報を提供します。 このメモはどんな種類のインターネット標準も指定しません。 このメモの分配は無制限です。
IESG Note:
IESGは以下に注意します。
The IESG takes no position on the validity of any Intellectual Property Rights statements contained in this document.
IESGは本書では含まれたどんなIntellectual Property Rights声明の正当性の立場も全く取りません。
Notices
通知
Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly
Copyright(c)1996L.ピーター・ドイツ語とジーン-ループ川ゲイル
Permission is granted to copy and distribute this document for any purpose and without charge, including translations into other languages and incorporation into compilations, provided that the copyright notice and this notice are preserved, and that any substantive changes or deletions from the original are clearly marked.
どんな目的のためのこのドキュメントもコピーして、配布するために許可を与えます、そして、無償に、明確に他の言語への翻訳と編集、版権情報とこの通知が保存されるか、そして、およびそれへの編入を含んでいるか、どんな実名詞も変えるオリジナルからの削除をマークします。
A pointer to the latest version of this and related documentation in HTML format can be found at the URL <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
URL<ftp://ftp.uu.net/グラフィックス/png/ドキュメント/zlib/zdoc-index.html>でこの最新版への指針とHTML形式における関連するドキュメンテーションを見つけることができます。
Abstract
要約
This specification defines a lossless compressed data format. The data can be produced or consumed, even for an arbitrarily long sequentially presented input data stream, using only an a priori bounded amount of intermediate storage. The format presently uses the DEFLATE compression method but can be easily extended to use other compression methods. It can be implemented readily in a manner not covered by patents. This specification also defines the ADLER-32 checksum (an extension and improvement of the Fletcher checksum), used for detection of data corruption, and provides an algorithm for computing it.
この仕様はlossless圧縮されたデータの形式を定義します。 データを作り出すか、または消費できます、連続して提示された任意に長い入力データ・ストリームのためにさえ、先験的な境界がある量の中間的ストレージだけを使用して。 形式を現在、DEFLATE圧縮方法を使用しますが、他の圧縮方法を使用するために容易に広げることができます。 特許でカバーされなかった方法で容易にそれを実装することができます。 この仕様は、また、データの汚染の検出に使用されるアドラー-32チェックサム(フレッチャーチェックサムの拡大と改良)を定義して、それを計算するためのアルゴリズムを提供します。
Deutsch & Gailly Informational [Page 1] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[1ページ]のRFC1950ZLIB
Table of Contents
目次
1. Introduction ................................................... 2 1.1. Purpose ................................................... 2 1.2. Intended audience ......................................... 3 1.3. Scope ..................................................... 3 1.4. Compliance ................................................ 3 1.5. Definitions of terms and conventions used ................ 3 1.6. Changes from previous versions ............................ 3 2. Detailed specification ......................................... 3 2.1. Overall conventions ....................................... 3 2.2. Data format ............................................... 4 2.3. Compliance ................................................ 7 3. References ..................................................... 7 4. Source code .................................................... 8 5. Security Considerations ........................................ 8 6. Acknowledgements ............................................... 8 7. Authors' Addresses ............................................. 8 8. Appendix: Rationale ............................................ 9 9. Appendix: Sample code ..........................................10
1. 序論… 2 1.1. 目的… 2 1.2. 聴衆は意図しました… 3 1.3. 範囲… 3 1.4. 承諾… 3 1.5. 用語と使用されるコンベンションの定義… 3 1.6. 旧バージョンからの変化… 3 2. 詳細な仕様… 3 2.1. 総合的なコンベンション… 3 2.2. データの形式… 4 2.3. 承諾… 7 3. 参照… 7 4. ソースコード… 8 5. セキュリティ問題… 8 6. 承認… 8 7. 作者のアドレス… 8 8. 付録: 原理… 9 9. 付録: コードを抽出してください…10
1. Introduction
1. 序論
1.1. Purpose
1.1. 目的
The purpose of this specification is to define a lossless compressed data format that:
この仕様の目的がlosslessを定義するのがデータの形式を圧縮したということである、それ:
* Is independent of CPU type, operating system, file system, and character set, and hence can be used for interchange;
* CPUタイプ、オペレーティングシステム、ファイルシステム、および文字集合から独立していて、したがって、置き換えに使用できます。
* Can be produced or consumed, even for an arbitrarily long sequentially presented input data stream, using only an a priori bounded amount of intermediate storage, and hence can be used in data communications or similar structures such as Unix filters;
* 先験的な境界がある量の中間的ストレージだけを使用して、連続して提示された任意に長い入力データ・ストリームのためにさえ生産するか、または消費できて、したがって、Unixフィルタなどのデータ通信か類似構造物で使用できます。
* Can use a number of different compression methods;
* 多くの異なった圧縮方法を使用できます。
* Can be implemented readily in a manner not covered by patents, and hence can be practiced freely.
* 特許でカバーされなかった方法で容易に実装することができて、したがって、自由に練習できます。
The data format defined by this specification does not attempt to allow random access to compressed data.
この仕様で定義されたデータの形式は、圧縮されたデータにランダムアクセスを許容するのを試みません。
Deutsch & Gailly Informational [Page 2] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[2ページ]のRFC1950ZLIB
1.2. Intended audience
1.2. 対象とする訪問者
This specification is intended for use by implementors of software to compress data into zlib format and/or decompress data from zlib format.
この仕様はソフトウェアの作成者による使用がzlib形式にデータを圧縮する、そして/または、zlib形式からデータを減圧することを意図します。
The text of the specification assumes a basic background in programming at the level of bits and other primitive data representations.
仕様のテキストはビットと他の原始のデータ表現のレベルでプログラムを作る際に基本的なバックグラウンドを仮定します。
1.3. Scope
1.3. 範囲
The specification specifies a compressed data format that can be used for in-memory compression of a sequence of arbitrary bytes.
仕様はメモリにおける、任意のバイトの系列の要約に使用できる圧縮されたデータの形式を指定します。
1.4. Compliance
1.4. 承諾
Unless otherwise indicated below, a compliant decompressor must be able to accept and decompress any data set that conforms to all the specifications presented here; a compliant compressor must produce data sets that conform to all the specifications presented here.
別の方法で以下で示されない場合、対応する減圧装置は、ここに提示されたすべての仕様に従うどんなデータセットも、受け入れて、減圧できなければなりません。 言いなりになっているコンプレッサーはここに提示されたすべての仕様に従うデータセットを作り出さなければなりません。
1.5. Definitions of terms and conventions used
1.5. 用語と使用されるコンベンションの定義
byte: 8 bits stored or transmitted as a unit (same as an octet). (For this specification, a byte is exactly 8 bits, even on machines which store a character on a number of bits different from 8.) See below, for the numbering of bits within a byte.
バイト: 8ビットは、ユニットとして(八重奏と同じ)で保存したか、または伝わりました。 (この仕様に関して、1バイトはちょうど8ビットです、8と異なった多くのビットの上にキャラクタを保存するマシンの上でさえ。) ビットの付番に関して1バイト以内で以下を見てください。
1.6. Changes from previous versions
1.6. 旧バージョンからの変化
Version 3.1 was the first public release of this specification. In version 3.2, some terminology was changed and the Adler-32 sample code was rewritten for clarity. In version 3.3, the support for a preset dictionary was introduced, and the specification was converted to RFC style.
バージョン3.1はこの仕様の最初の公共のリリースでした。 バージョン3.2では、何らかの用語を変えました、そして、明快ためにアドラー-32サンプルコードを書き直しました。 バージョン3.3では、aが辞書をあらかじめセットしたので、サポートを導入しました、そして、RFCスタイルに仕様を変換しました。
2. Detailed specification
2. 仕様詳細
2.1. Overall conventions
2.1. 総合的なコンベンション
In the diagrams below, a box like this:
以下のダイヤグラム、このような箱の中に:
+---+ | | <-- the vertical bars might be missing +---+
+---+ | | <-- 縦棒は+を逃しているかもしれません。---+
Deutsch & Gailly Informational [Page 3] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[3ページ]のRFC1950ZLIB
represents one byte; a box like this:
1バイトを表します。 このような箱:
+==============+ | | +==============+
+==============+ | | +==============+
represents a variable number of bytes.
可変バイト数を表します。
Bytes stored within a computer do not have a "bit order", since they are always treated as a unit. However, a byte considered as an integer between 0 and 255 does have a most- and least- significant bit, and since we write numbers with the most- significant digit on the left, we also write bytes with the most- significant bit on the left. In the diagrams below, we number the bits of a byte so that bit 0 is the least-significant bit, i.e., the bits are numbered:
それらが一体にしていつも扱われるので、コンピュータの中に保存されたバイトは「噛み付いているオーダー」を持っていません。 しかしながら、0〜255の整数であるとみなされた1バイトはだいたいと最少重要なビットを持っています、そして、左における最も多くの有効数字に従った数を書くので、また、私たちは大部分が重要な状態で左で噛み付かれたバイトを書きます。 以下のダイヤグラムで、私たちが1バイトのビットに付番するのでビット0が最下位ビットである、すなわち、ビットは番号付です:
+--------+ |76543210| +--------+
+--------+ |76543210| +--------+
Within a computer, a number may occupy multiple bytes. All multi-byte numbers in the format described here are stored with the MOST-significant byte first (at the lower memory address). For example, the decimal number 520 is stored as:
コンピュータの中では、数は複数のバイトを占領するかもしれません。 ここで説明された形式のすべてのマルチバイト番号が最初に(下側のメモリアドレスで)、MOST重要なバイトで保存されます。 例えば、10進数520は以下として保存されます。
0 1 +--------+--------+ |00000010|00001000| +--------+--------+ ^ ^ | | | + less significant byte = 8 + more significant byte = 2 x 256
0 1 +--------+--------+ |00000010|00001000| +--------+--------+ ^ ^ | | | + それほど重要でないバイト=より8+重要なバイト=2x256
2.2. Data format
2.2. データの形式
A zlib stream has the following structure:
zlibストリームには、以下の構造があります:
0 1 +---+---+ |CMF|FLG| (more-->) +---+---+
0 1 +---+---+ |CMF|FLG| (以上-->) +---+---+
Deutsch & Gailly Informational [Page 4] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[4ページ]のRFC1950ZLIB
(if FLG.FDICT set)
(FLG.FDICTがセットしたなら)
0 1 2 3 +---+---+---+---+ | DICTID | (more-->) +---+---+---+---+
0 1 2 3 +---+---+---+---+ | DICTID| (以上-->) +---+---+---+---+
+=====================+---+---+---+---+ |...compressed data...| ADLER32 | +=====================+---+---+---+---+
+=====================+---+---+---+---+ |...データを圧縮します…| ADLER32| +=====================+---+---+---+---+
Any data which may appear after ADLER32 are not part of the zlib stream.
ADLER32がzlibについて一部にならなかった後に現れるどんなデータも流れます。
CMF (Compression Method and flags) This byte is divided into a 4-bit compression method and a 4- bit information field depending on the compression method.
CMF、(圧縮Methodと旗) このバイトは4ビットの圧縮方法と圧縮方法に依存する4の噛み付いている情報フィールドに分割されます。
bits 0 to 3 CM Compression method bits 4 to 7 CINFO Compression info
ビット0〜3CM Compressionメソッドビット4〜7CINFO Compressionインフォメーション
CM (Compression method) This identifies the compression method used in the file. CM = 8 denotes the "deflate" compression method with a window size up to 32K. This is the method used by gzip and PNG (see references [1] and [2] in Chapter 3, below, for the reference documents). CM = 15 is reserved. It might be used in a future version of this specification to indicate the presence of an extra field before the compressed data.
CM、(圧縮方法) これはファイルで使用される圧縮方法を特定します。 CM=8はウィンドウサイズで「空気を抜いてください」という圧縮方法を32Kまで指示します。 これはgzipとPNGによって使用されたメソッド(以下で参考書類に関して第3章における参照[1]と[2]を見る)です。 CM=15は予約されています。 それは、圧縮されたデータの前に付加的な分野の存在を示すのにこの仕様の将来のバージョンで使用されるかもしれません。
CINFO (Compression info) For CM = 8, CINFO is the base-2 logarithm of the LZ77 window size, minus eight (CINFO=7 indicates a 32K window size). Values of CINFO above 7 are not allowed in this version of the specification. CINFO is not defined in this specification for CM not equal to 8.
CM=8のためのCINFO(圧縮インフォメーション)、CINFOはLZ77ウィンドウサイズのベース-2対数です、8を引いて(CINFO=7は32Kのウィンドウサイズを示します)。 7を超えたCINFOの値は仕様のこのバージョンに許容されていません。 CINFOは8と等しくないCMのためのこの仕様に基づき定義されません。
FLG (FLaGs) This flag byte is divided as follows:
FLG、(FLaGs) このフラグバイトは以下の通り分割されます:
bits 0 to 4 FCHECK (check bits for CMF and FLG) bit 5 FDICT (preset dictionary) bits 6 to 7 FLEVEL (compression level)
ビット0〜4FCHECK(CMFとFLGのためのチェックビット)は6〜7FLEVELに5FDICT(辞書をあらかじめセットする)ビット噛み付きました。(圧縮レベル)
The FCHECK value must be such that CMF and FLG, when viewed as a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG), is a multiple of 31.
FCHECK値がそのようなそのCMFとFLGでなければならない、MSBに保存された16ビットの符号のない整数として見なされると、オーダー(CMF*256+FLG)は31の倍数です。
Deutsch & Gailly Informational [Page 5] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[5ページ]のRFC1950ZLIB
FDICT (Preset dictionary) If FDICT is set, a DICT dictionary identifier is present immediately after the FLG byte. The dictionary is a sequence of bytes which are initially fed to the compressor without producing any compressed output. DICT is the Adler-32 checksum of this sequence of bytes (see the definition of ADLER32 below). The decompressor can use this identifier to determine which dictionary has been used by the compressor.
FDICTがあるなら、FDICT(辞書をあらかじめセットする)はセットして、DICT辞書識別子はFLGバイト直後存在しています。 辞書は初めはどんな圧縮された出力も起こさないでコンプレッサーへ供給されるバイトの系列です。 DICTはバイトのこの系列のアドラー-32チェックサム(以下のADLER32の定義を見る)です。 減圧装置は、どの辞書がコンプレッサーによって使用されたかを決定するのにこの識別子を使用できます。
FLEVEL (Compression level) These flags are available for use by specific compression methods. The "deflate" method (CM = 8) sets these flags as follows:
FLEVEL、(圧縮レベル) これらの旗は特定の圧縮方法で使用に利用可能です。 「空気を抜いてください」というメソッド(CM=8)は以下のこれらの旗を設定します:
0 - compressor used fastest algorithm 1 - compressor used fast algorithm 2 - compressor used default algorithm 3 - compressor used maximum compression, slowest algorithm
0--コンプレッサーは最も速いアルゴリズム1を使用しました--コンプレッサーは速くアルゴリズム2を使用しました--コンプレッサーはデフォルトアルゴリズム3を使用しました--コンプレッサーは最大の圧縮を使用しました、最も遅いアルゴリズム
The information in FLEVEL is not needed for decompression; it is there to indicate if recompression might be worthwhile.
FLEVELの情報は減圧に必要ではありません。 再圧縮価値があるかもしれないかどうかを示すために、それはそこにあります。
compressed data For compression method 8, the compressed data is stored in the deflate compressed data format as described in the document "DEFLATE Compressed Data Format Specification" by L. Peter Deutsch. (See reference [3] in Chapter 3, below)
圧縮されたデータFor圧縮方法8、圧縮されたデータが中に保存される、ドキュメントでL.ピーターによる「圧縮されたデータの形式仕様に空気を抜かせてください」というドイツ語を説明するので、圧縮されたデータの形式に空気を抜かせてください。 (以下で第3章における参照[3]を見ます)
Other compressed data formats are not specified in this version of the zlib specification.
他の圧縮されたデータ形式はzlib仕様のこのバージョンで指定されません。
ADLER32 (Adler-32 checksum) This contains a checksum value of the uncompressed data (excluding any dictionary data) computed according to Adler-32 algorithm. This algorithm is a 32-bit extension and improvement of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 standard. See references [4] and [5] in Chapter 3, below)
ADLER32、(アドラー-32チェックサム) これはアドラー-32アルゴリズムによると、計算された解凍されたデータ(どんな辞書データを除いた)のチェックサム値を含んでいます。 このアルゴリズムは、フレッチャーアルゴリズムの32ビットの拡大と改良です、8073年のITU-T X.224 / ISO規格では、使用されています。 見る、第3章における参照[4]と[5]、下)
Adler-32 is composed of two sums accumulated per byte: s1 is the sum of all bytes, s2 is the sum of all s1 values. Both sums are done modulo 65521. s1 is initialized to 1, s2 to zero. The Adler-32 checksum is stored as s2*65536 + s1 in most- significant-byte first (network) order.
アドラー-32は1バイト単位で蓄積された2つの合計で構成されます: s1がすべてのバイトの合計である、s2はすべてのs1値の合計です。 両方の合計に法65521をします。1、ゼロへのs2にs1を初期化します。 アドラー-32チェックサムは大部分の重要なバイトのs2*65536+s1の最初(ネットワーク)のオーダーとして保存されます。
Deutsch & Gailly Informational [Page 6] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[6ページ]のRFC1950ZLIB
2.3. Compliance
2.3. 承諾
A compliant compressor must produce streams with correct CMF, FLG and ADLER32, but need not support preset dictionaries. When the zlib data format is used as part of another standard data format, the compressor may use only preset dictionaries that are specified by this other data format. If this other format does not use the preset dictionary feature, the compressor must not set the FDICT flag.
言いなりになっているコンプレッサーは正しいCMF、FLG、およびADLER32と共にストリームを生産しなければなりませんが、サポートは辞書をあらかじめセットする必要はありませんか? zlibデータの形式が別の標準データ形式、コンプレッサーの一部が使用するように使用されているとき、使用はこの他のデータの形式によって指定される辞書をあらかじめセットしただけです。 この他の形式が辞書が特集するあらかじめセットすることを使用しないなら、コンプレッサーはFDICT旗を設定してはいけません。
A compliant decompressor must check CMF, FLG, and ADLER32, and provide an error indication if any of these have incorrect values. A compliant decompressor must give an error indication if CM is not one of the values defined in this specification (only the value 8 is permitted in this version), since another value could indicate the presence of new features that would cause subsequent data to be interpreted incorrectly. A compliant decompressor must give an error indication if FDICT is set and DICTID is not the identifier of a known preset dictionary. A decompressor may ignore FLEVEL and still be compliant. When the zlib data format is being used as a part of another standard format, a compliant decompressor must support all the preset dictionaries specified by the other format. When the other format does not use the preset dictionary feature, a compliant decompressor must reject any stream in which the FDICT flag is set.
これらのどれかに不正確な値があるなら、対応する減圧装置は、CMF、FLG、およびADLER32をチェックして、誤り表示を提供しなければなりません。 対応する減圧装置はCMがこの仕様に基づき定義された値の1つ(値8だけがこのバージョンで受入れられる)でないなら誤り表示を与えなければなりません、別の値が不当に順次データを解釈する新機能の存在を示すかもしれないので。 必須が誤り表示を与える対応する減圧装置はFDICTが用意ができて、DICTIDが知られているaに関する識別子でないなら辞書をあらかじめセットしました。 減圧装置は、FLEVELを無視して、まだ対応するかもしれません。 zlibデータの形式が別の標準書式の一部として使用されているとき、対応する減圧装置は、すべてあらかじめセットするのがもう片方の形式によって指定された辞書であるとサポートしなければなりません。 もう片方の形式が辞書が特集するあらかじめセットすることを使用しないと、対応する減圧装置はFDICT旗が設定されるどんなストリームも拒絶しなければなりません。
3. References
3. 参照
[1] Deutsch, L.P.,"GZIP Compressed Data Format Specification", available in ftp://ftp.uu.net/pub/archiving/zip/doc/
[1] ドイツ語、L.P.、 ftp://ftp.uu.net/pub/archiving/zip/doc/ で利用可能な"GZIP Compressed Data Format Specification"
[2] Thomas Boutell, "PNG (Portable Network Graphics) specification", available in ftp://ftp.uu.net/graphics/png/documents/
[2] トーマスBoutell、 ftp://ftp.uu.net/graphics/png/documents/ で利用可能な「PNG(携帯用のNetwork Graphics)仕様」
[3] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification", available in ftp://ftp.uu.net/pub/archiving/zip/doc/
[3] ドイツ語、L.P.、 ftp://ftp.uu.net/pub/archiving/zip/doc/ で利用可能な"DEFLATE Compressed Data Format Specification"
[4] Fletcher, J. G., "An Arithmetic Checksum for Serial Transmissions," IEEE Transactions on Communications, Vol. COM-30, No. 1, January 1982, pp. 247-252.
[4] フレッチャー、J.G.、「直列伝送のための算数のチェックサム」、Communications、Vol.COM-30、No.1、1982年1月、ページのIEEE Transactions 247-252.
[5] ITU-T Recommendation X.224, Annex D, "Checksum Algorithms," November, 1993, pp. 144, 145. (Available from gopher://info.itu.ch). ITU-T X.244 is also the same as ISO 8073.
[5] ITU-T Recommendation X.224、Annex D、「チェックサムアルゴリズム」、1993年11月、ページ 144, 145. (リス://info.itu.chから利用可能な。) また、ITU-T X.244もISO8073と同じです。
Deutsch & Gailly Informational [Page 7] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[7ページ]のRFC1950ZLIB
4. Source code
4. ソースコード
Source code for a C language implementation of a "zlib" compliant library is available at ftp://ftp.uu.net/pub/archiving/zip/zlib/.
"zlib"対応することのライブラリのC言語実装のためのソースコードは ftp://ftp.uu.net/pub/archiving/zip/zlib/ で利用可能です。
5. Security Considerations
5. セキュリティ問題
A decoder that fails to check the ADLER32 checksum value may be subject to undetected data corruption.
ADLER32チェックサム価値をチェックしないデコーダは非検出されたデータの汚染を受けることがあるかもしれません。
6. Acknowledgements
6. 承認
Trademarks cited in this document are the property of their respective owners.
本書では引用された商標は彼らのそれぞれの所有者の資産です。
Jean-Loup Gailly and Mark Adler designed the zlib format and wrote the related software described in this specification. Glenn Randers-Pehrson converted this document to RFC and HTML format.
ジーン-ループ川のゲイルとマーク・アドラーは、zlib形式を設計して、この仕様で説明された関連するソフトウェアを書きました。 グレン・ラナース-パーソンはRFCとHTML形式にこのドキュメントを変換しました。
7. Authors' Addresses
7. 作者のアドレス
L. Peter Deutsch Aladdin Enterprises 203 Santa Margarita Ave. Menlo Park, CA 94025
L.ピータードイツ語アラジンエンタープライズ203サンタマルガリータAve。 メンローパーク、カリフォルニア 94025
Phone: (415) 322-0103 (AM only) FAX: (415) 322-1734 EMail: <ghost@aladdin.com>
以下に電話をしてください。 (415) 322-0103(AM専用)FAX: (415) 322-1734 メールしてください: <幽霊@aladdin.com>。
Jean-Loup Gailly
ジーン-ループ川ゲイル
EMail: <gzip@prep.ai.mit.edu>
メール: <gzip@prep.ai.mit.edu>。
Questions about the technical content of this specification can be sent by email to
メールで仕様を送ることができるこの技術的な内容に関して、質問します。
Jean-Loup Gailly <gzip@prep.ai.mit.edu> and Mark Adler <madler@alumni.caltech.edu>
ジーン-ループ川 Gailly <gzip@prep.ai.mit.edu 、gt;、 Adler <madler@alumni.caltech.edu をマークしてください、gt。
Editorial comments on this specification can be sent by email to
社説はメールで仕様を送ることができるこれに関してコメントします。
L. Peter Deutsch <ghost@aladdin.com> and Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
L.ピーター Deutsch <ghost@aladdin.com 、gt;、グレン Randers-Pehrson <randeg@alumni.rpi.edu 、gt。
Deutsch & Gailly Informational [Page 8] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[8ページ]のRFC1950ZLIB
8. Appendix: Rationale
8. 付録: 原理
8.1. Preset dictionaries
8.1. 辞書をあらかじめセットしてください。
A preset dictionary is specially useful to compress short input sequences. The compressor can take advantage of the dictionary context to encode the input in a more compact manner. The decompressor can be initialized with the appropriate context by virtually decompressing a compressed version of the dictionary without producing any output. However for certain compression algorithms such as the deflate algorithm this operation can be achieved without actually performing any decompression.
特に、あらかじめセットされて、辞書は、短い入力系列を圧縮するために役に立ちます。 コンプレッサーは、よりコンパクトな方法による入力をコード化するのに辞書文脈を利用できます。 適切な関係で実際にはどんな出力も起こさないで辞書の圧縮されたバージョンを減圧することによって、減圧装置を初期化できます。 しかしながら、ある圧縮アルゴリズム、アルゴリズムに実際にどんな減圧も実行しながらこの操作を達成できる空気を抜かせてください。
The compressor and the decompressor must use exactly the same dictionary. The dictionary may be fixed or may be chosen among a certain number of predefined dictionaries, according to the kind of input data. The decompressor can determine which dictionary has been chosen by the compressor by checking the dictionary identifier. This document does not specify the contents of predefined dictionaries, since the optimal dictionaries are application specific. Standard data formats using this feature of the zlib specification must precisely define the allowed dictionaries.
コンプレッサーと減圧装置はまさに同じ辞書を使用しなければなりません。 辞書は、修理されているか、またはある数の事前に定義された辞書の中で選ばれるかもしれません、入力データの種類に従って。 減圧装置は、どの辞書が辞書識別子をチェックすることによってコンプレッサーによって選ばれたかを決定できます。 最適の辞書がアプリケーション特有であるので、このドキュメントは事前に定義された辞書のコンテンツを指定しません。 zlib仕様のこの特徴を使用する標準データ形式は正確に許容辞書を定義しなければなりません。
8.2. The Adler-32 algorithm
8.2. アドラー-32アルゴリズム
The Adler-32 algorithm is much faster than the CRC32 algorithm yet still provides an extremely low probability of undetected errors.
アドラー-32アルゴリズムはCRC32アルゴリズムがまだまだ非検出された誤りの非常に低い確率を提供しているよりはるかに速いです。
The modulo on unsigned long accumulators can be delayed for 5552 bytes, so the modulo operation time is negligible. If the bytes are a, b, c, the second sum is 3a + 2b + c + 3, and so is position and order sensitive, unlike the first sum, which is just a checksum. That 65521 is prime is important to avoid a possible large class of two-byte errors that leave the check unchanged. (The Fletcher checksum uses 255, which is not prime and which also makes the Fletcher check insensitive to single byte changes 0 <-> 255.)
未署名の長いアキュムレータの上の法が5552バイト遅らせることができるので、法演算時間は取るにたらないです。 そうがただチェックサムである最初の合計と異なって機密のバイトはaです、b、c、2番目の合計が3a+2b+c+3であり、位置と注文であるなら。 65521が主要であることは、チェックを変わりがないままにする可能な多人数のクラスの2バイトの誤りを避けるために重要です。 (フレッチャーチェックサムは主要でない255を使用して、また、どれがフレッチャーチェックを単一のバイトに神経が鈍くするかが0<->255を変えます。)
The sum s1 is initialized to 1 instead of zero to make the length of the sequence part of s2, so that the length does not have to be checked separately. (Any sequence of zeroes has a Fletcher checksum of zero.)
合計s1はs2の系列一部の長さを作るためにゼロの代わりに1に初期化されます、長さが別々にチェックされる必要はないように。 (ゼロのどんな系列にも、ゼロのフレッチャーチェックサムがあります。)
Deutsch & Gailly Informational [Page 9] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[9ページ]のRFC1950ZLIB
9. Appendix: Sample code
9. 付録: サンプルコード
The following C code computes the Adler-32 checksum of a data buffer. It is written for clarity, not for speed. The sample code is in the ANSI C programming language. Non C users may find it easier to read with these hints:
以下のCコードはデータバッファのアドラー-32チェックサムを計算します。 それは速度のために書かれているのではなく、明快ために書かれています。 ANSI Cプログラミング言語にはサンプルコードがあります。 非Cユーザは、これらのヒントで読書するのが、より簡単であることがわかるかもしれません:
& Bitwise AND operator. >> Bitwise right shift operator. When applied to an unsigned quantity, as here, right shift inserts zero bit(s) at the left. << Bitwise left shift operator. Left shift inserts zero bit(s) at the right. ++ "n++" increments the variable n. % modulo operator: a % b is the remainder of a divided by b.
ANDオペレータをBitwiseします。 >>は正しいシフトオペレータをBitwiseします。 正しいシフト差し込みがここで左におけるビットのゼロに合っていて未署名の量に適用されると。 <<は左のシフトオペレータをBitwiseします。 左のシフト差し込みは権利におけるビットのゼロに合っています。 + +、「n++」は可変nを増加します。 %、法オペレータ: %bはbが割られたaの残りです。
#define BASE 65521 /* largest prime smaller than 65536 */
#65536*/より小さく基地の65521/*最も大きい第1を定義してください。
/* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. The Adler-32 checksum should be initialized to 1.
/*は、バイトbuf[0..len-1]で実行しているアドラー-32チェックサムをアップデートして、アップデートされたチェックサムを返します。 アドラー-32チェックサムは1に初期化されるべきです。
Usage example:
使用例:
unsigned long adler = 1L;
未署名の長いadlerは1Lと等しいです。
while (read_buffer(buffer, length) != EOF) { adler = update_adler32(adler, buffer, length); } if (adler != original_adler) error(); */ unsigned long update_adler32(unsigned long adler, unsigned char *buf, int len) { unsigned long s1 = adler & 0xffff; unsigned long s2 = (adler >> 16) & 0xffff; int n;
(_バッファ(バッファ、長さ)!=EOFを読みます) adler=アップデート_adler32(adler、バッファ、長さ); (adler!はオリジナル_adlerと等しいです)誤り()であるなら。 */未署名の長いアップデート_adler32(未署名の長いadler、未署名の炭の*をbufされます、int len)、未署名の長いs1はadlerと0xffffと等しいです; 未署名の長いs2は(adler>>16)と0xffffと等しいです; int n
for (n = 0; n < len; n++) { s1 = (s1 + buf[n]) % BASE; s2 = (s2 + s1) % BASE; } return (s2 << 16) + s1; }
(n=0; n<len; n++)、s1が等しい、(s1+buf[n])%基地; s2は%基地と等しいです(s2+s1);、+ リターン(s2<<16)s1。 }
/* Return the adler32 of the bytes buf[0..len-1] */
/*はバイトbuf[0..len-1]*/のadler32を返します。
Deutsch & Gailly Informational [Page 10] RFC 1950 ZLIB Compressed Data Format Specification May 1996
データの形式仕様1996年5月に圧縮されたドイツ語とゲイルの情報[10ページ]のRFC1950ZLIB
unsigned long adler32(unsigned char *buf, int len) { return update_adler32(1L, buf, len); }
未署名の長いadler32(未署名の炭*buf、int len)リターンアップデート_adler32(1L、buf、len)。
Deutsch & Gailly Informational [Page 11]
ドイツ語とゲイル情報です。[11ページ]
一覧
スポンサーリンク