%!PS-Adobe-2.0
%%Creator: dvipsk 5.55a Copyright 1986, 1994 Radical Eye Software
%%Title: rfc-gzip-a4.ps
%%Pages: 11
%%PageOrder: Ascend
%%BoundingBox: 0 0 612 792
%%DocumentFonts: Times-Roman Times-Bold Times-Italic Courier
%%EndComments
%DVIPSCommandLine: dvips -D 300 -o gzip-a4.ps gzip-a4.dvi
%DVIPSParameters: dpi=300, compressed, comments removed
%DVIPSSource: TeX output 1996.05.23:2049
%%BeginProcSet: texc.pro
/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N
/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72
mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1}
ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale
isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div
hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul
TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if}
forall round exch round exch]setmatrix}N /@landscape{/isls true N}B
/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B
/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{
/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N
string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N
end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{
/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]
N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup
length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{
128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub
get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data
dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N
/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup
/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx
0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff
setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff
1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N
/cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id
gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp
add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add
/gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{
dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1
adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2
idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string
putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval
adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg}
{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{
adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2
chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{]
}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup
length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{
cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin
0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul
add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore showpage
userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook
known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X
/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for
65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0
0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V
{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7
getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false}
ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false
RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1
false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform
round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg
rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail
{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M}
B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{
4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{
p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p
a}B /bos{/SS save N}B /eos{SS restore}B end
%%EndProcSet
%%BeginProcSet: texps.pro
TeXDict begin /rf{findfont dup length 1 add dict begin{1 index /FID ne 2
index /UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll
exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics
exch def dict begin Encoding{exch dup type /integertype ne{pop pop 1 sub
dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def}
ifelse}forall Metrics /Metrics currentdict end def[2 index currentdict
end definefont 3 -1 roll makefont /setfont load]cvx def}def
/ObliqueSlant{dup sin S cos div neg}B /SlantFont{4 index mul add}def
/ExtendFont{3 -1 roll mul exch}def /ReEncodeFont{/Encoding exch def}def
end
%%EndProcSet
TeXDict begin 40258431 52099146 1000 300 300 (gzip-a4.dvi)
@start /Fa 2 104 df<133C13E0EA01C013801203AD13005A121C12F0121C12077E1380
AD120113C0EA00E0133C0E297D9E15>102 D<12F0121C12077E1380AD120113C0EA00E0
133C13E0EA01C013801203AD13005A121C12F00E297D9E15>I E
/Fb 60[25 72[25 25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 1[25 25 25 25 25 25 25 25 25 3[25 1[25 25 2[25
25 25 25 25 25 25 25 25 25 25 25 2[25 25 1[25 25 25 25
25 25 1[25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 3[25 25 33[{}77 41.666668
/Courier rf /Fc 81[25 52[23 23 2[25 15 18 20 1[25 23
25 38 13 2[13 25 23 1[20 25 20 25 23 6[30 1[33 3[30 25
33 2[35 33 43 30 2[18 1[35 28 30 33 33 15[23 23 23 2[11
15 3[15 15 40[{}42 45.624989 /Times-Bold rf /Fd 60[27
70[27 1[27 27 27 27 27 27 27 27 27 1[27 27 27 27 27 27
1[27 27 27 27 27 27 27 27 27 4[27 1[27 1[27 3[27 27 27
1[27 27 27 27 27 1[27 27 27 27 27 27 27 27 1[27 27 1[27
27 27 1[27 27 27 27 27 27 27 27 27 27 27 1[27 27 27 27
1[27 27 27 4[27 34[{}69 45.624989 /Courier rf /Fe 141[18
1[23 23 5[13 7[23 97[{}5 45.624989 /Times-Italic rf /Ff
81[28 55[25 28 17 19 22 1[28 25 28 41 14 2[14 28 25 17
22 28 22 28 25 13[28 2[30 39 1[47 3[19 2[30 1[36 36 12[25
25 25 25 25 25 2[12 46[{}35 50.000000 /Times-Bold rf
/Fg 2 63 df<EC01C0EC0780EC1E001478EB01E0EB0780010EC7FC133C13F0EA03C0000F
C8FC123C12F0A2123C120FEA03C0EA00F0133C130E6D7EEB01E0EB0078141EEC0780EC01
C01A1A7C9723>60 D<12E01278121EEA0780EA01E0EA0078131C130FEB03C0EB00F0143C
140FEC03C0A2EC0F00143C14F0EB03C0010FC7FC131C1378EA01E0EA0780001EC8FC1278
12E01A1A7C9723>62 D E /Fh 2 16 df<EB01FE90380FFFC090383E01F09038F0003CD8
01C0130E48487F48C7EA0380000EEC01C0000C1400001C15E048157000301530A2007015
3800601518A200E0151C48150CA96C151C00601518A20070153800301530A2003815706C
15E0000C15C0000E14016CEC03806C6CEB07006C6C130ED800F0133C90383E01F090380F
FFC0D901FEC7FC262B7DA02D>13 D<EA07E0EA1FF8EA3FFCEA7FFEA2B5FCA8EA7FFEA2EA
3FFCEA1FF8EA07E010127D9317>15 D E /Fi 81[33 51[27 30
30 43 1[33 20 23 27 1[33 30 33 50 17 33 1[17 33 30 20
27 33 27 33 30 12[40 33 43 3[43 56 40 1[30 23 1[47 1[40
43 43 1[43 6[20 1[30 30 30 30 30 30 30 30 3[20 5[20 39[{}48
59.999973 /Times-Bold rf /Fj 81[40 55[36 1[20 28 24 1[36
36 36 56 20 2[20 2[24 32 1[32 1[32 6[44 9[40 6[24 1[52
18[36 36 4[18 46[{}22 72.000000 /Times-Roman rf /Fk 60[15
8[20 10[25 25 3[20 47[20 23 23 33 23 23 13 18 15 23 23
23 23 35 13 23 1[13 23 23 15 20 23 20 23 20 3[15 1[15
28 1[33 43 33 33 28 25 30 33 25 33 33 40 28 1[18 15 33
33 25 28 33 30 30 33 42 2[26 1[13 13 23 23 23 23 23 23
23 23 23 23 13 11 15 11 1[23 15 15 15 39[{}78 45.624989
/Times-Roman rf end
%%EndProlog
%%BeginSetup
%%Feature: *Resolution 300dpi
TeXDict begin
%%EndSetup
%%Page: 1 1
1 0 bop 0 195 a Fk(Network)10 b(W)l(orking)h(Group)1226
b(P)-5 b(.)12 b(Deutsch)0 252 y(Request)f(for)g(Comments:)k(1952)974
b(Aladdin)10 b(Enterprises)0 308 y(Category:)k(Informational)1244
b(May)12 b(1996)340 479 y Fj(GZIP)17 b(\256le)h(format)f
(speci\256cation)f(version)i(4.3)0 704 y Fi(Status)d(of)g(This)g(Memo)0
836 y Fk(This)d(memo)i(provides)e(information)g(for)h(the)f(Internet)h
(community)m(.)20 b(This)12 b(memo)i(does)f(not)f(specify)h(an)g
(Internet)0 893 y(standard)d(of)i(any)f(kind.)j(Distribution)8
b(of)j(this)f(memo)i(is)f(unlimited.)0 1068 y Fi(IESG)k(Note:)0
1201 y Fk(The)d(IESG)h(takes)f(no)g(position)f(on)h(the)g(validity)f
(of)h(any)h(Intellectual)e(Property)h(Rights)g(statements)f(contained)h
(in)0 1257 y(this)e(document.)0 1433 y Fi(Notices)0 1565
y Fk(Copyright)208 1564 y(c)196 1565 y Fh(\015)i Fk(1996)e(L.)h(Peter)h
(Deutsch)0 1651 y(Permission)c(is)g(granted)g(to)g(copy)f(and)i
(distribute)d(this)h(document)h(for)h(any)f(purpose)g(and)g(without)e
(char)o(ge,)k(including)0 1707 y(translations)e(into)h(other)g
(languages)g(and)h(incorporation)e(into)g(compilations,)h(provided)g
(that)g(the)h(copyright)e(notice)0 1764 y(and)i(this)g(notice)g(are)h
(preserved,)g(and)f(that)g(any)h(substantive)d(changes)i(or)h
(deletions)d(from)k(the)e(original)f(are)i(clearly)0
1820 y(marked.)0 1906 y(A)i(pointer)g(to)g(the)g(latest)f(version)h(of)
g(this)f(and)h(related)h(documentation)d(in)i(HTML)h(format)f(can)h(be)
f(found)g(at)g(the)0 1963 y(URL)e Fg(<)p Fk
(
ftp://ftp.uu.net/graphics/p)o(ng/)o(documents)o(/zli)o(b/zdo)o
(c-index.ht)o(ml)p Fg(>)p Fk(.)0 2139 y Fi(Abstract)0
2273 y Fk(This)c(speci\256cation)g(de\256nes)g(a)i(lossless)c
(compressed)j(data)g(format)g(that)f(is)h(compatible)f(with)f(the)i
(widely)f(used)g(GZIP)0 2329 y(utility)m(.)16 b(The)c(format)g
(includes)f(a)h(cyclic)g(redundancy)f(check)h(value)g(for)g(detecting)f
(data)h(corruption.)k(The)c(format)0 2386 y(presently)7
b(uses)g(the)h(DEFLA)-5 b(TE)6 b(method)i(of)g(compression)f(but)g(can)
h(be)g(easily)f(extended)g(to)g(use)h(other)f(compression)0
2442 y(methods.)15 b(The)c(format)g(can)h(be)f(implemented)g(readily)f
(in)h(a)g(manner)h(not)f(covered)g(by)g(patents.)0 2869
y(Deutsch)661 b(Informational)f([Page)12 b(1])p eop
%%Page: 2 2
2 1 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)0 195 y Fi(Contents)0
298 y Fk(1)104 b(Introduction)32 b(.)23 b(.)h(.)f(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(2)68 355 y(1.1)70 b(Purpose)44 b(.)23 b(.)h(.)f(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(2)68 411 y(1.2)70 b(Intended)11 b(audience)29 b(.)23
b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)
91 b(2)68 468 y(1.3)70 b(Scope)12 b(.)23 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(2)68 524 y(1.4)70 b(Compliance)40 b(.)23 b(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(2)68 581 y(1.5)70 b(De\256nitions)10 b(of)h(terms)g(and)g
(conventions)e(used)38 b(.)23 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91 b(3)68
637 y(1.6)70 b(Changes)11 b(from)h(previous)e(versions)h(.)24
b(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91 b(3)0 694
y(2)104 b(Detailed)11 b(speci\256cation)33 b(.)23 b(.)g(.)g(.)g(.)g(.)g
(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91 b(3)68
750 y(2.1)70 b(Overall)11 b(conventions)26 b(.)d(.)g(.)g(.)g(.)g(.)g(.)
h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91 b(3)68
806 y(2.2)70 b(File)12 b(format)21 b(.)j(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(4)68 863 y(2.3)70 b(Member)13 b(format)41 b(.)23 b(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(4)173 919 y(2.3.1)54 b(Member)13 b(header)e(and)g(trailer)28
b(.)23 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91 b(5)318
976 y(Extra)11 b(\256eld)j(.)23 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91 b(7)318 1032 y(Compliance)19
b(.)k(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)
g(.)91 b(7)0 1089 y(3)104 b(References)24 b(.)f(.)g(.)h(.)f(.)g(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(7)0 1145 y(4)104 b(Security)11 b(Considerations)26
b(.)d(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)
91 b(8)0 1202 y(5)104 b(Acknowledgements)33 b(.)23 b(.)g(.)g(.)g(.)g(.)
g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(8)0 1258 y(6)104 b(Author)r(')n(s)9 b(Address)40 b(.)23
b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g
(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)
g(.)g(.)91 b(8)0 1315 y(7)104 b(Appendix:)13 b(Jean-Loup)e(Gailly')n(s)
e(gzip)h(utility)39 b(.)23 b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)
g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(9)0 1371 y(8)104 b(Appendix:)13 b(Sample)f(CRC)g(Code)h(.)23
b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g
(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)91
b(9)0 1548 y Fi(1)60 b(Intr)o(oduction)0 1683 y Ff(1.1)50
b(Purpose)0 1801 y Fk(The)11 b(purpose)f(of)i(this)e(speci\256cation)g
(is)g(to)h(de\256ne)h(a)f(lossless)e(compressed)i(data)g(format)h
(that:)68 1888 y Fh(\017)23 b Fk(Is)14 b(independent)e(of)i(CPU)g
(type,)h(operating)d(system,)j(\256le)f(system,)g(and)g(character)h
(set,)f(and)g(hence)g(can)g(be)114 1944 y(used)c(for)i(interchange;)68
2031 y Fh(\017)23 b Fk(Can)11 b(compress)h(or)f(decompress)g(a)h(data)f
(stream)h(\(as)g(opposed)e(to)h(a)g(randomly)g(accessible)g(\256le\))h
(to)f(produce)114 2088 y(another)i(data)g(stream,)i(using)d(only)h(an)g
Fe(a)h(priori)e Fk(bounded)g(amount)h(of)h(intermediate)f(storage,)h
(and)f(hence)114 2144 y(can)e(be)g(used)g(in)g(data)g(communications)f
(or)h(similar)g(structures)f(such)g(as)i(Unix)e(\256lters;)68
2231 y Fh(\017)23 b Fk(Compresses)10 b(data)g(with)g(ef)o(\256ciency)h
(comparable)f(to)g(the)g(best)g(currently)g(available)f
(general-purpose)h(com-)114 2287 y(pression)f(methods,)i(and)g(in)g
(particular)g(considerably)e(better)i(than)g(the)g(\252compress\272)g
(program;)68 2374 y Fh(\017)23 b Fk(Can)9 b(be)f(implemented)g(readily)
g(in)g(a)h(manner)g(not)f(covered)g(by)g(patents,)h(and)f(hence)h(can)g
(be)f(practiced)g(freely;)68 2461 y Fh(\017)23 b Fk(Is)13
b(compatible)h(with)e(the)i(\256le)g(format)g(produced)g(by)f(the)h
(current)f(widely)g(used)h(gzip)f(utility)m(,)g(in)g(that)g(con-)114
2518 y(forming)d(decompressors)h(will)f(be)h(able)g(to)g(read)h(data)f
(produced)f(by)h(the)g(existing)e(gzip)i(compressor)n(.)0
2605 y(The)g(data)g(format)h(de\256ned)f(by)g(this)f(speci\256cation)g
(does)h(not)f(attempt)h(to:)68 2692 y Fh(\017)23 b Fk(Provide)10
b(random)i(access)f(to)g(compressed)g(data;)0 2869 y(Deutsch)661
b(Informational)f([Page)12 b(2])p eop
%%Page: 3 3
3 2 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)68 195 y Fh(\017)23
b Fk(Compress)9 b(specialized)g(data)g(\(e.g.,)i(raster)f(graphics\))f
(as)h(well)f(as)g(the)g(best)g(currently)g(available)g(specialized)114
252 y(algorithms.)0 400 y Ff(1.2)50 b(Intended)12 b(audience)0
515 y Fk(This)c(speci\256cation)f(is)i(intended)e(for)i(use)g(by)f
(implementors)g(of)h(software)f(to)g(compress)h(data)g(into)e(gzip)i
(format)g(and/)0 571 y(or)i(decompress)g(data)g(from)h(gzip)f(format.)0
655 y(The)h(text)g(of)g(the)g(speci\256cation)f(assumes)h(a)h(basic)e
(background)h(in)f(programming)h(at)g(the)g(level)g(of)g(bits)g(and)g
(other)0 711 y(primitive)e(data)h(representations.)0
860 y Ff(1.3)50 b(Scope)0 974 y Fk(The)12 b(speci\256cation)g
(speci\256es)g(a)h(compression)f(method)g(and)g(a)h(\256le)g(format)g
(\(the)f(latter)g(assuming)g(only)f(that)h(a)h(\256le)0
1031 y(can)g(store)g(a)g(sequence)g(of)g(arbitrary)f(bytes\).)20
b(It)13 b(does)f(not)g(specify)h(any)f(particular)h(interface)g(to)f(a)
i(\256le)f(system)f(or)0 1087 y(anything)d(about)i(character)h(sets)e
(or)h(encodings)f(\(except)h(for)h(\256le)f(names)h(and)f(comments,)g
(which)g(are)h(optional\).)0 1236 y Ff(1.4)50 b(Compliance)0
1350 y Fk(Unless)8 b(otherwise)g(indicated)g(below)m(,)h(a)g(compliant)
f(decompressor)h(must)g(be)g(able)g(to)f(accept)i(and)f(decompress)f
(any)0 1406 y(\256le)15 b(that)e(conforms)i(to)f(all)g(the)g
(speci\256cations)f(presented)h(here;)i(a)f(compliant)e(compressor)h
(must)g(produce)g(\256les)0 1463 y(that)f(conform)g(to)g(all)h(the)f
(speci\256cations)f(presented)h(here.)22 b(The)14 b(material)f(in)g
(the)g(appendices)g(is)g(not)g(part)g(of)g(the)0 1519
y(speci\256cation)d(per)i(se)f(and)g(is)f(not)h(relevant)g(to)f
(compliance.)0 1668 y Ff(1.5)50 b(De\256nitions)11 b(of)h(terms)h(and)f
(conventions)f(used)0 1782 y Fk(byte:)k(8)c(bits)f(stored)h(or)h
(transmitted)e(as)h(a)h(unit)e(\(same)j(as)e(an)h(octet\).)k(\(For)11
b(this)g(speci\256cation,)g(a)g(byte)g(is)g(exactly)g(8)0
1839 y(bits,)g(even)g(on)g(machines)g(which)g(store)f(a)i(character)g
(on)f(a)h(number)f(of)g(bits)g(dif)o(ferent)g(from)h(8.\))j(See)d
(below)f(for)g(the)0 1895 y(numbering)f(of)i(bits)e(within)f(a)j(byte.)
0 2044 y Ff(1.6)50 b(Changes)12 b(fr)o(om)h(pr)o(evious)f(versions)0
2158 y Fk(There)d(have)f(been)g(no)g(technical)g(changes)g(to)g(the)g
(gzip)g(format)g(since)g(version)g(4.1)g(of)g(this)f(speci\256cation.)
14 b(In)8 b(version)0 2215 y(4.2,)i(some)g(terminology)e(was)h
(changed,)h(and)f(the)g(sample)g(CRC)i(code)e(was)h(rewritten)e(for)i
(clarity)f(and)g(to)g(eliminate)0 2271 y(the)i(requirement)f(for)h(the)
g(caller)g(to)f(do)g(pre-)i(and)e(post-conditionin)o(g.)i(V)-5
b(ersion)10 b(4.3)h(is)f(a)i(conversion)d(of)i(the)f(speci-)0
2328 y(\256cation)h(to)f(RFC)j(style.)0 2498 y Fi(2)60
b(Detailed)13 b(speci\256cation)0 2630 y Ff(2.1)50 b(Overall)12
b(conventions)0 2744 y Fk(In)f(the)g(diagrams)g(below)m(,)g(a)h(box)e
(like)h(this:)0 2869 y(Deutsch)661 b(Informational)f([Page)12
b(3])p eop
%%Page: 4 4
4 3 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)114 195 y Fd(+---+)114
252 y(|)82 b(|)27 b(<--)h(the)g(vertical)i(bars)e(might)h(be)f(missing)
114 308 y(+---+)0 395 y Fk(represents)11 b(one)g(byte;)f(a)h(box)g
(like)g(this:)114 482 y Fd(+==============)q(+)114 538
y(|)382 b(|)114 595 y(+==============)q(+)0 682 y Fk(represents)11
b(a)g(variable)g(number)g(of)g(bytes.)0 769 y(Bytes)c(stored)g(within)f
(a)i(computer)f(do)g(not)g(have)g(a)h(\252bit)f(order)r(\272,)h(since)f
(they)g(are)h(always)f(treated)h(as)f(a)h(unit.)13 b(However)n(,)0
825 y(a)e(byte)g(considered)f(as)h(an)g(integer)f(between)h(0)f(and)h
(255)f(does)h(have)g(a)g(most-)g(and)f(least-signi\256cant)f(bit,)i
(and)g(since)0 882 y(we)e(write)f(numbers)g(with)g(the)g
(most-signi\256cant)f(digit)g(on)i(the)f(left,)h(we)g(also)f(write)g
(bytes)g(with)g(the)g(most-signi\256cant)0 938 y(bit)k(on)g(the)g
(left.)19 b(In)12 b(the)h(diagrams)f(below)m(,)g(we)h(number)f(the)h
(bits)e(of)h(a)h(byte)f(so)g(that)g(bit)g(0)g(is)g(the)g
(least-signi\256cant)0 995 y(bit,)f(i.e.,)h(the)f(bits)f(are)i
(numbered:)114 1094 y Fd(+--------+)114 1151 y(|76543210|)114
1207 y(+--------+)0 1307 y Fk(This)g(document)h(does)f(not)g(address)h
(the)g(issue)f(of)h(the)g(order)g(in)f(which)h(bits)e(of)i(a)h(byte)e
(are)i(transmitted)e(on)g(a)i(bit-)0 1363 y(sequential)c(medium,)h
(since)g(the)g(data)g(format)h(described)e(here)i(is)f(byte-)f(rather)i
(than)e(bit-oriented.)0 1450 y(W)n(ithin)d(a)h(computer)n(,)h(a)g
(number)f(may)h(occupy)e(multiple)g(bytes.)14 b(All)7
b(multi-byte)g(numbers)h(in)f(the)h(format)h(described)0
1506 y(here)i(are)g(stored)e(with)h(the)g(least-signi\256cant)e(byte)i
(\256rst)g(\(at)h(the)f(lower)g(memory)h(address\).)k(For)c(example,)g
(the)f(dec-)0 1563 y(imal)h(number)g(520)g(is)g(stored)f(as:)223
1650 y Fd(0)218 b(1)114 1706 y(+--------+-----)q(---)q(+)114
1763 y(|00001000|00000)q(010)q(|)114 1819 y(+--------+-----)q(---)q(+)
141 1876 y(\303)g(\303)141 1932 y(|)g(|)141 1989 y(|)g(+)28
b(more)g(significant)j(byte)d(=)f(2)h(x)g(256)141 2045
y(+)f(less)i(significant)h(byte)e(=)g(8)0 2200 y Ff(2.2)50
b(File)13 b(format)0 2317 y Fk(A)i(gzip)f(\256le)h(consists)e(of)h(a)h
(series)g(of)f(\252members\272)i(\(compressed)f(data)f(sets\).)26
b(The)14 b(format)h(of)g(each)g(member)h(is)0 2374 y(speci\256ed)f(in)f
(the)g(following)f(section.)25 b(The)15 b(members)h(simply)d(appear)i
(one)g(after)g(another)g(in)f(the)g(\256le,)j(with)d(no)0
2430 y(additional)9 b(information)h(before,)i(between,)f(or)g(after)h
(them.)0 2585 y Ff(2.3)50 b(Member)13 b(format)0 2703
y Fk(Each)e(member)i(has)d(the)h(following)f(structure:)0
2869 y(Deutsch)661 b(Informational)f([Page)12 b(4])p
eop
%%Page: 5 5
5 4 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)114 195 y Fd(+---+---+---+--)q
(-+-)q(--+-)q(--+-)q(--+)q(---+)q(---+)q(---)q(+)114
252 y(|ID1|ID2|CM)30 b(|FLG|)138 b(MTIME)f(|XFL|OS)30
b(|)d(\(more-->\))114 308 y(+---+---+---+--)q(-+-)q(--+-)q(--+-)q(--+)q
(---+)q(---+)q(---)q(+)0 395 y Fk(\(if)11 b(FLG.FEXTRA)h(set\))114
482 y Fd(+---+---+======)q(===)q(====)q(====)q(===)q(====)q(====)q(===)
q(==+)114 538 y(|)27 b(XLEN)56 b(|...XLEN)29 b(bytes)g(of)f("extra)h
(field"...|)h(\(more-->\))114 595 y(+---+---+======)q(===)q(====)q
(====)q(===)q(====)q(====)q(===)q(==+)0 682 y Fk(\(if)11
b(FLG.FNAME)h(set\))114 769 y Fd(+==============)q(===)q(====)q(====)q
(===)q(====)q(====)q(===)q(==+)114 825 y(|...original)30
b(file)f(name,)f(zero-terminat)q(ed.)q(..|)j(\(more-->\))114
882 y(+==============)q(===)q(====)q(====)q(===)q(====)q(====)q(===)q
(==+)0 969 y Fk(\(if)11 b(FLG.FCOMMENT)h(set\))114 1056
y Fd(+==============)q(===)q(====)q(====)q(===)q(====)q(===+)114
1112 y(|...file)29 b(comment,)h(zero-terminated)q(...|)h(\(more-->\))
114 1169 y(+==============)q(===)q(====)q(====)q(===)q(====)q(===+)0
1256 y Fk(\(if)11 b(FLG.FHCRC)i(set\))114 1343 y Fd(+---+---+)114
1399 y(|)27 b(CRC16)i(|)114 1456 y(+---+---+)114 1555
y(+==============)q(===)q(====)q(==+)114 1612 y(|...compressed)i
(blocks...|)f(\(more-->\))114 1668 y(+==============)q(===)q(====)q
(==+)168 1767 y(0)82 b(1)g(2)g(3)h(4)f(5)g(6)g(7)114
1824 y(+---+---+---+--)q(-+-)q(--+-)q(--+-)q(--+)q(---+)114
1880 y(|)136 b(CRC32)i(|)f(ISIZE)g(|)114 1937 y(+---+---+---+--)q(-+-)q
(--+-)q(--+-)q(--+)q(---+)0 2090 y Fc(2.3.1)45 b(Member)12
b(header)g(and)g(trailer)11 2197 y(ID1)f(\(IDenti\256cation)g(1\))11
2284 y(ID2)g(\(IDenti\256cation)g(2\))114 2361 y Fk(These)f(have)g(the)
g(\256xed)g(values)g(ID1)g(=)g(31)g(\(0x1f,)g Fd(\\)p
Fk(037\),)h(ID2)f(=)g(139)f(\(0x8b,)h Fd(\\)p Fk(213\),)h(to)f
(identify)f(the)h(\256le)g(as)114 2418 y(being)g(in)h(gzip)f(format.)11
2505 y Fc(CM)h(\(Compr)o(ession)g(Method\))114 2581 y
Fk(This)c(identi\256es)f(the)i(compression)f(method)g(used)h(in)f(the)h
(\256le.)14 b(CM)9 b(=)f(0-7)f(are)i(reserved.)14 b(CM)9
b(=)f(8)g(denotes)e(the)114 2638 y(\252de\257ate\272)i(compression)e
(method,)j(which)d(is)h(the)h(one)f(customarily)f(used)h(by)h(gzip)f
(and)g(which)g(is)g(documented)114 2694 y(elsewhere.)0
2869 y(Deutsch)661 b(Informational)f([Page)12 b(5])p
eop
%%Page: 6 6
6 5 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)11 195 y Fc(FLG)g(\(FLaGs\))114
272 y Fk(This)e(\257ag)h(byte)g(is)g(divided)e(into)h(individual)f
(bits)h(as)h(follows:)214 367 y Fd(bit)28 b(0)82 b(FTEXT)214
424 y(bit)28 b(1)82 b(FHCRC)214 480 y(bit)28 b(2)82 b(FEXTRA)214
537 y(bit)28 b(3)82 b(FNAME)214 593 y(bit)28 b(4)82 b(FCOMMENT)214
650 y(bit)28 b(5)82 b(reserved)214 706 y(bit)28 b(6)82
b(reserved)214 763 y(bit)28 b(7)82 b(reserved)114 858
y Fk(If)9 b(FTEXT)g(is)f(set,)i(the)e(\256le)h(is)g(probably)f(ASCII)i
(text.)j(This)8 b(is)h(an)g(optional)e(indication,)h(which)g(the)h
(compres-)114 915 y(sor)f(may)i(set)f(by)g(checking)f(a)i(small)e
(amount)h(of)g(the)g(input)f(data)h(to)f(see)i(whether)f(any)f
(non-ASCII)i(characters)114 971 y(are)i(present.)17 b(In)12
b(case)g(of)g(doubt,)f(FTEXT)h(is)f(cleared,)i(indicating)d(binary)h
(data.)17 b(For)12 b(systems)f(which)g(have)114 1027
y(dif)o(ferent)i(\256le)g(formats)g(for)h(ascii)e(text)h(and)g(binary)f
(data,)i(the)f(decompressor)g(can)g(use)g(FTEXT)g(to)g(choose)114
1084 y(the)f(appropriate)g(format.)21 b(W)l(e)14 b(deliberately)e(do)g
(not)g(specify)h(the)f(algorithm)g(used)h(to)f(set)h(this)e(bit,)i
(since)g(a)114 1140 y(compressor)d(always)h(has)g(the)f(option)g(of)h
(leaving)f(it)g(cleared)i(and)f(a)g(decompressor)g(always)f(has)h(the)g
(option)114 1197 y(of)g(ignoring)e(it)i(and)g(letting)e(some)j(other)f
(program)g(handle)f(issues)g(of)i(data)f(conversion.)114
1274 y(If)e(FHCRC)i(is)e(set,)g(a)h(CRC16)g(for)f(the)g(gzip)g(header)g
(is)g(present,)h(immediately)e(before)i(the)f(compressed)g(data.)114
1330 y(The)f(CRC16)i(consists)d(of)i(the)f(two)h(least)f(signi\256cant)
f(bytes)h(of)h(the)g(CRC32)g(for)g(all)g(bytes)f(of)h(the)g(gzip)f
(header)114 1387 y(up)g(to)h(and)g(not)f(including)f(the)i(CRC16.)15
b([The)9 b(FHCRC)h(bit)f(was)g(never)g(set)f(by)h(versions)f(of)h(gzip)
f(up)h(to)g(1.2.4,)114 1443 y(even)i(though)e(it)i(was)g(documented)g
(with)f(a)h(dif)o(ferent)g(meaning)g(in)g(gzip)g(1.2.4.])114
1520 y(If)g(FEXTRA)g(is)g(set,)g(optional)f(extra)h(\256elds)g(are)h
(present,)f(as)g(described)f(in)h(a)h(following)d(section.)114
1597 y(If)f(FNAME)g(is)g(set,)h(an)f(original)e(\256le)i(name)h(is)f
(present,)g(terminated)g(by)f(a)i(zero)f(byte.)14 b(The)8
b(name)g(must)g(consist)114 1653 y(of)i(ISO)h(8859-1)e(\(LA)-5
b(TIN-1\))10 b(characters;)g(on)g(operating)f(systems)g(using)g(EBCDIC)
i(or)g(any)f(other)f(character)114 1710 y(set)h(for)g(\256le)h(names,)g
(the)f(name)h(must)f(be)g(translated)f(to)h(the)g(ISO)h(LA)-5
b(TIN-1)10 b(character)h(set.)j(This)c(is)g(the)g(orig-)114
1766 y(inal)i(name)h(of)g(the)g(\256le)g(being)f(compressed,)i(with)d
(any)i(directory)f(components)g(removed,)i(and,)f(if)g(the)g(\256le)114
1822 y(being)8 b(compressed)g(is)g(on)h(a)g(\256le)g(system)f(with)g
(case)h(insensitive)e(names,)j(forced)f(to)f(lower)g(case.)15
b(There)9 b(is)g(no)114 1879 y(original)g(\256le)i(name)h(if)f(the)g
(data)g(was)f(compressed)h(from)h(a)f(source)g(other)f(than)h(a)g
(named)h(\256le;)e(for)i(example,)114 1935 y(if)f(the)g(source)g(was)g
(stdin)e(on)i(a)h(Unix)e(system,)h(there)g(is)g(no)g(\256le)g(name.)114
2012 y(If)d(FCOMMENT)h(is)f(set,)h(a)g(zero-terminated)f(\256le)h
(comment)f(is)g(present.)14 b(This)7 b(comment)i(is)f(not)f
(interpreted;)114 2069 y(it)i(is)h(only)g(intended)f(for)h(human)g
(consumption.)k(The)c(comment)g(must)g(consist)f(of)i(ISO)f(8859-1)g
(\(LA)-5 b(TIN-1\))114 2125 y(characters.)15 b(Line)c(breaks)g(should)f
(be)h(denoted)f(by)h(a)h(single)d(line)i(feed)h(character)g(\(10)e
(decimal\).)114 2202 y(Reserved)h(FLG)g(bits)f(must)h(be)g(zero.)11
2289 y Fc(MTIME)h(\(Modi\256cation)f(TIME\))114 2366
y Fk(This)f(gives)g(the)g(most)h(recent)g(modi\256cation)f(time)h(of)g
(the)g(original)e(\256le)i(being)f(compressed.)15 b(The)c(time)g(is)g
(in)114 2422 y(Unix)e(format,)j(i.e.,)f(seconds)f(since)g(00:00:00)e
(GMT)m(,)j(Jan.)k(1,)c(1970.)j(\(Note)c(that)g(this)f(may)i(cause)g
(problems)114 2479 y(for)g(MS-DOS)h(and)f(other)f(systems)g(that)h(use)
g(local)f(rather)h(than)g(Universal)f(time.\))15 b(If)d(the)e
(compressed)h(data)114 2535 y(did)i(not)g(come)h(from)g(a)g(\256le,)h
(MTIME)f(is)f(set)h(to)f(the)g(time)h(at)g(which)f(compression)f
(started.)22 b(MTIME)15 b(=)e(0)114 2592 y(means)e(no)g(time)g(stamp)g
(is)g(available.)11 2679 y Fc(XFL)h(\(eXtra)f(FLags\))0
2869 y Fk(Deutsch)661 b(Informational)f([Page)12 b(6])p
eop
%%Page: 7 7
7 6 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)114 195 y(These)f(\257ags)h(are)h
(available)e(for)h(use)g(by)f(speci\256c)h(compression)f(methods.)17
b(The)11 b(\252de\257ate\272)i(method)e(\(CM)i(=)114
252 y(8\))e(sets)f(these)h(\257ags)g(as)h(follows:)214
347 y Fd(XFL)28 b(=)f(2)h(-)f(compressor)j(used)f(maximum)g
(compression,)486 404 y(slowest)h(algorithm)214 460 y(XFL)e(=)f(4)h(-)f
(compressor)j(used)f(fastest)g(algorithm)11 555 y Fc(OS)12
b(\(Operating)g(System\))114 632 y Fk(This)h(identi\256es)f(the)i(type)
f(of)h(\256le)h(system)e(on)g(which)h(compression)f(took)f(place.)24
b(This)13 b(may)h(be)g(useful)g(in)114 689 y(determining)c(end-of-line)
g(convention)f(for)j(text)e(\256les.)16 b(The)11 b(currently)f
(de\256ned)h(values)g(are)h(as)f(follows:)263 778 y Fb(0)25
b(-)g(FAT)g(filesystem)f(\(MS-DOS,)g(OS/2,)g(NT/Win32\))263
827 y(1)h(-)g(Amiga)263 877 y(2)g(-)g(VMS)g(\(or)f(OpenVMS\))263
927 y(3)h(-)g(Unix)263 977 y(4)g(-)g(VM/CMS)263 1027
y(5)g(-)g(Atari)g(TOS)263 1076 y(6)g(-)g(HPFS)g(filesystem)f(\(OS/2,)g
(NT\))263 1126 y(7)h(-)g(Macintosh)263 1176 y(8)g(-)g(Z-System)263
1226 y(9)g(-)g(CP/M)239 1276 y(10)f(-)h(TOPS-20)239 1326
y(11)f(-)h(NTFS)g(filesystem)f(\(NT\))239 1375 y(12)g(-)h(QDOS)239
1425 y(13)f(-)h(Acorn)g(RISCOS)214 1475 y(255)f(-)h(unknown)11
1570 y Fc(XLEN)12 b(\(eXtra)g(LENgth\))114 1647 y Fk(If)f(FLG.FEXTRA)h
(is)e(set,)i(this)e(gives)g(the)h(length)f(of)h(the)g(optional)e(extra)
j(\256eld.)j(See)d(below)e(for)i(details.)11 1734 y Fc(CRC32)f
(\(CRC-32\))114 1811 y Fk(This)h(contains)g(a)h(Cyclic)g(Redundancy)g
(Check)h(value)e(of)i(the)f(uncompressed)f(data)h(computed)g(according)
114 1868 y(to)c(CRC-32)i(algorithm)e(used)g(in)h(the)g(ISO)g(3309)f
(standard)g(and)h(in)g(section)f(8.1.1.6.2)h(of)g(ITU-T)g(recommen-)114
1924 y(dation)h(V)-6 b(.42.)18 b(\(See)13 b(
http://www)m(.iso.ch)c(for)
k(ordering)e(ISO)i(documents.)k(See)c(
gopher://info.itu.ch)d(for)i(an)
114 1980 y(online)e(version)g(of)h(ITU-T)g(V)-6 b(.42.\))11
2078 y Fc(ISIZE)12 b(\(Input)g(SIZE\))114 2165 y Fk(This)e(contains)g
(the)h(size)g(of)g(the)g(original)f(\(uncompressed\))g(input)g(data)h
(modulo)f(2\30332.)0 2318 y Fc(Extra)j(\256eld)46 b Fk(If)13
b(the)g(FLG.FEXTRA)g(bit)f(is)g(set,)h(an)g(\252extra)g(\256eld\272)g
(is)g(present)f(in)g(the)h(header)n(,)h(with)e(total)f(length)0
2374 y(XLEN)g(bytes.)j(It)d(consists)e(of)j(a)f(series)g(of)g
(sub\256elds,)g(each)g(of)h(the)e(form:)114 2461 y Fd(+---+---+---+--)q
(-+=)q(====)q(====)q(===)q(====)q(====)q(===)q(====)q(====)q(===)q(+)
114 2518 y(|SI1|SI2|)57 b(LEN)e(|...)28 b(LEN)g(bytes)h(of)f(subfield)h
(data)g(...|)114 2574 y(+---+---+---+--)q(-+=)q(====)q(====)q(===)q
(====)q(====)q(===)q(====)q(====)q(===)q(+)0 2661 y Fk(SI1)13
b(and)f(SI2)g(provide)g(a)g(sub\256eld)g(ID,)h(typically)d(two)i(ASCII)
h(letters)f(with)f(some)h(mnemonic)h(value.)18 b(Jean-Loup)0
2718 y(Gailly)10 b Fg(<)p Fk(
[email protected])p Fg(>)i
Fk(is)f(maintaining)f(a)i(registry)e(of)i(sub\256eld)f(IDs;)g(please)g
(send)g(him)h(any)f(sub\256eld)0 2869 y(Deutsch)661 b(Informational)f
([Page)12 b(7])p eop
%%Page: 8 8
8 7 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)0 195 y(ID)c(you)g(wish)f(to)h
(use.)14 b(Sub\256eld)8 b(IDs)g(with)g(SI2)g(=)g(0)h(are)g(reserved)f
(for)g(future)g(use.)14 b(The)9 b(following)d(IDs)i(are)h(currently)0
252 y(de\256ned:)114 335 y Fd(SI1)246 b(SI2)g(Data)114
392 y(----------)57 b(----------)g(----)114 448 y(0x41)28
b(\('A'\))56 b(0x70)28 b(\('P'\))56 b(Apollo)29 b(file)f(type)h
(information)0 532 y Fk(LEN)11 b(gives)f(the)h(length)f(of)h(the)g
(sub\256eld)f(data,)i(excluding)d(the)i(4)g(initial)f(bytes.)0
680 y Fc(Compliance)45 b Fk(A)16 b(compliant)e(compressor)i(must)f
(produce)h(\256les)g(with)f(correct)h(ID1,)h(ID2,)g(CM,)g(CRC32,)h(and)
0 736 y(ISIZE,)c(but)f(may)h(set)g(all)f(the)g(other)h(\256elds)f(in)g
(the)h(\256xed-length)e(part)i(of)f(the)h(header)g(to)f(default)g
(values)g(\(255)g(for)0 793 y(OS,)f(0)f(for)g(all)g(others\).)k(The)c
(compressor)g(must)g(set)f(all)h(reserved)h(bits)e(to)g(zero.)0
877 y(A)f(compliant)f(decompressor)h(must)g(check)g(ID1,)h(ID2,)g(and)f
(CM,)h(and)f(provide)f(an)i(error)f(indication)e(if)i(any)g(of)h(these)
0 933 y(have)i(incorrect)f(values.)17 b(It)12 b(must)f(examine)h
(FEXTRA/XLEN,)f(FNAME,)i(FCOMMENT)f(and)g(FHCRC)h(at)f(least)0
989 y(so)d(it)g(can)h(skip)f(over)h(the)f(optional)f(\256elds)i(if)f
(they)g(are)i(present.)j(It)c(need)f(not)g(examine)h(any)g(other)f
(part)h(of)f(the)h(header)0 1046 y(or)i(trailer;)g(in)f(particular)n(,)
h(a)h(decompressor)e(may)i(ignore)e(FTEXT)g(and)h(OS)g(and)g(always)g
(produce)f(binary)g(output,)0 1102 y(and)j(still)e(be)i(compliant.)22
b(A)14 b(compliant)e(decompressor)i(must)f(give)g(an)h(error)h
(indication)c(if)j(any)g(reserved)g(bit)f(is)0 1159 y(non-zero,)d
(since)g(such)g(a)h(bit)e(could)g(indicate)h(the)g(presence)g(of)g(a)h
(new)f(\256eld)g(that)g(would)f(cause)h(subsequent)f(data)h(to)0
1215 y(be)h(interpreted)g(incorrectly)m(.)0 1386 y Fi(3)60
b(Refer)o(ences)0 1517 y Fk([1])8 b(\252Information)f(Processing)f(-)i
(8-bit)f(single-byte)f(coded)h(graphic)g(character)h(sets)f(-)h(Part)g
(1:)13 b(Latin)6 b(alphabet)h(No.1\272)0 1573 y(\(ISO)12
b(8859-1:1987\).)i(The)d(ISO)h(8859-1)e(\(Latin-1\))h(character)h(set)g
(is)e(a)i(superset)f(of)g(7-bit)g(ASCII.)17 b(Files)11
b(de\256ning)0 1630 y(this)f(character)i(set)f(are)h(available)e(as)h
(iso)p 665 1630 14 2 v 16 w(8859-1.*)f(in)h(
ftp://ftp.uu.net/graph)o
(ics/p)o(ng/)o(documents)o(/)0 1714 y([2])g(ISO)h(3309)0
1798 y([3])f(ITU-T)g(recommendation)g(V)-6 b(.42)0 1881
y([4])11 b(Deutsch,)f(L.P)-5 b(.,\252DEFLA)g(TE)11 b(Compressed)f(Data)
g(Format)h(Speci\256cation\272,)g(available)f(in)g
(
ftp://ftp.uu.net/pub)o(/)0 1938 y(archiving/zip/doc/)0
2022 y([5])h(Gailly)m(,)g(J.-L.,)h(GZIP)f(documentation,)f(available)h
(as)g(gzip-*.tar)g(in)f(
ftp://prep.ai.mit.edu/pub/gnu)o(/)0
2106 y([6])i(Sarwate,)h(D.V)-6 b(.,)12 b(\252Computation)f(of)g(Cyclic)
h(Redundancy)f(Checks)h(via)f(T)m(able)g(Look-Up\272,)g(Communications)
0 2162 y(of)g(the)g(ACM,)h(31\(8\),)g(pp.1008-1013.)0
2246 y([7])f(Schwaderer)n(,)i(W)l(.D.,)f(\252CRC)g(Calculation\272,)f
(April)f(85)h(PC)h(T)m(ech)f(Journal,)f(pp.1)n(18-133.)0
2330 y([8])h(
ftp://ftp.adelaide.edu.au/pub/rocks)o(oft/)o(papers/crc)p
945 2330 V 14 w(v3.txt,)f(describing)g(the)h(CRC)h(concept.)0
2501 y Fi(4)60 b(Security)13 b(Considerations)0 2632
y Fk(Any)d(data)g(compression)f(method)g(involves)g(the)h(reduction)f
(of)h(redundancy)f(in)h(the)g(data.)15 b(Consequently)m(,)9
b(any)h(cor)o(-)0 2688 y(ruption)g(of)h(the)g(data)g(is)f(likely)g(to)h
(have)g(severe)h(ef)o(fects)f(and)g(be)g(dif)o(\256cult)g(to)g
(correct.)k(Uncompressed)c(text,)g(on)f(the)0 2744 y(other)h(hand,)g
(will)f(probably)g(still)f(be)j(readable)f(despite)f(the)h(presence)g
(of)h(some)f(corrupted)g(bytes.)0 2869 y(Deutsch)661
b(Informational)f([Page)12 b(8])p eop
%%Page: 9 9
9 8 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)0 195 y(It)e(is)g(recommended)h
(that)f(systems)f(using)g(this)g(data)i(format)f(provide)g(some)g
(means)h(of)f(validating)f(the)h(integrity)e(of)0 252
y(the)j(compressed)g(data,)g(such)g(as)g(by)g(setting)f(and)h(checking)
f(the)h(CRC-32)h(check)f(value.)0 428 y Fi(5)60 b(Acknowledgements)0
562 y Fk(T)n(rademarks)12 b(cited)f(in)f(this)g(document)h(are)h(the)f
(property)f(of)h(their)g(respective)g(owners.)0 649 y(Jean-Loup)g
(Gailly)g(designed)f(the)i(gzip)g(format)g(and)g(wrote,)g(with)f(Mark)h
(Adler)n(,)h(the)e(related)h(software)g(described)0 705
y(in)f(this)f(speci\256cation.)k(Glenn)c(Randers-Pehrson)h(converted)g
(this)f(document)h(to)f(RFC)j(and)e(HTML)g(format.)0
882 y Fi(6)60 b(Author)q(')n(s)15 b(Addr)o(ess)0 1016
y Fk(L.)c(Peter)h(Deutsch)114 1103 y Fd(Aladdin)29 b(Enterprises)114
1159 y(203)f(Santa)g(Margarita)i(Ave.)114 1216 y(Menlo)e(Park,)h(CA)f
(94025)114 1329 y(Phone:)h(\(415\))f(322-0103)i(\(AM)e(only\))114
1385 y(FAX:)83 b(\(415\))28 b(322-1734)114 1441 y(EMail:)h
(<ghost@aladdin.)q(com>)0 1528 y Fk(Questions)9 b(about)i(the)f
(technical)h(content)f(of)h(this)f(speci\256cation)g(can)i(be)f(sent)g
(by)g(email)g(to:)114 1615 y Fd(Jean-Loup)29 b(Gailly)g(<
[email protected])q
(i.mi)q(t.ed)q(u>)i(and)114 1672 y(Mark)d(Adler)h(<madler@alumni.)q
(cal)q(tech)q(.edu)q(>)0 1759 y Fk(Editorial)9 b(comments)j(on)e(this)h
(speci\256cation)f(can)h(be)g(sent)g(by)g(email)g(to:)114
1846 y Fd(L.)27 b(Peter)i(Deutsch)g(<ghost@aladd)q(in.c)q(om>)i(and)114
1902 y(Glenn)d(Randers-Pehr)q(son)j(<randeg@alumni.)q(rpi)q(.edu)q(>)0
2079 y Fi(7)60 b(Appendix:)20 b(Jean-Loup)14 b(Gailly')n(s)f(gzip)h
(utility)0 2213 y Fk(The)f(most)g(widely)g(used)f(implementation)g(of)i
(gzip)f(compression,)g(and)g(the)g(original)f(documentation)g(on)h
(which)0 2269 y(this)e(speci\256cation)h(is)g(based,)g(were)h(created)g
(by)f(Jean-Loup)g(Gailly)f Fg(<)p Fk(
[email protected])p
Fg(>)p Fk(.)19 b(Since)13 b(this)e(im-)0 2326 y(plementation)g(is)h(a)h
(de)f(facto)g(standard,)h(we)f(mention)g(some)g(more)h(of)g(its)e
(features)h(here.)20 b(Again,)12 b(the)g(material)h(in)0
2382 y(this)8 b(section)g(is)g(not)g(part)h(of)g(the)f(speci\256cation)
g(per)h(se,)h(and)e(implementations)g(need)g(not)g(follow)g(it)g(to)h
(be)g(compliant.)0 2469 y(When)i(compressing)f(or)i(decompressing)e(a)i
(\256le,)g(gzip)f(preserves)g(the)g(protection,)g(ownership,)f(and)h
(modi\256cation)0 2526 y(time)h(attributes)e(on)h(the)g(local)g(\256le)
h(system,)g(since)f(there)h(is)f(no)g(provision)e(for)j(representing)f
(protection)f(attributes)0 2582 y(in)i(the)g(gzip)g(\256le)h(format)g
(itself.)18 b(Since)12 b(the)h(\256le)f(format)h(includes)e(a)i
(modi\256cation)e(time,)i(the)g(gzip)f(decompressor)0
2639 y(provides)h(a)h(command)g(line)f(switch)g(that)g(assigns)f(the)i
(modi\256cation)f(time)h(from)g(the)g(\256le,)h(rather)f(than)f(the)h
(local)0 2695 y(modi\256cation)c(time)h(of)h(the)e(compressed)h(input,)
g(to)f(the)h(decompressed)g(output.)0 2869 y(Deutsch)661
b(Informational)f([Page)12 b(9])p eop
%%Page: 10 10
10 9 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)0 195 y Fi(8)60
b(Appendix:)20 b(Sample)14 b(CRC)h(Code)0 329 y Fk(The)j(following)e
(sample)j(code)f(represents)g(a)g(practical)g(implementation)f(of)h
(the)g(CRC)i(\(Cyclic)e(Redundancy)0 385 y(Check\).)e(\(See)c(also)e
(ISO)i(3309)e(and)h(ITU-T)g(V)-6 b(.42)11 b(for)h(a)f(formal)h
(speci\256cation.\))0 472 y(The)g(sample)f(code)h(is)f(in)h(the)f(ANSI)
h(C)h(programming)e(language.)17 b(Non)11 b(C)h(users)f(may)i(\256nd)e
(it)h(easier)g(to)f(read)h(with)0 529 y(these)f(hints:)114
609 y Fb(&)149 b(Bitwise)24 b(AND)h(operator.)114 659
y(\303)149 b(Bitwise)24 b(exclusive-OR)g(operator.)114
709 y(>>)124 b(Bitwise)24 b(right)h(shift)f(operator.)g(When)h(applied)
f(to)h(an)288 759 y(unsigned)f(quantity,)g(as)h(here,)f(right)h(shift)f
(inserts)g(zero)288 808 y(bit\(s\))g(at)h(the)g(left.)114
858 y(!)149 b(Logical)24 b(NOT)h(operator.)114 908 y(++)124
b("n++")24 b(increments)g(the)h(variable)f(n.)114 958
y(0xNNN)49 b(0x)25 b(introduces)f(a)g(hexadecimal)g(\(base)h(16\))f
(constant.)288 1008 y(Suffix)g(L)h(indicates)f(a)h(long)g(value)f(\(at)
h(least)f(32)h(bits\).)114 1107 y(/*)f(Table)h(of)g(CRCs)f(of)h(all)f
(8-bit)h(messages.)f(*/)114 1157 y(unsigned)g(long)g(crc)p
539 1157 13 2 v 15 w(table[256];)114 1257 y(/*)g(Flag:)h(has)f(the)h
(table)f(been)h(computed?)f(Initially)g(false.)g(*/)114
1307 y(int)g(crc)p 290 1307 V 15 w(table)p 430 1307 V
14 w(computed)h(=)f(0;)114 1406 y(/*)g(Make)h(the)g(table)f(for)h(a)f
(fast)h(CRC.)f(*/)114 1456 y(void)g(make)p 340 1456 V
15 w(crc)p 430 1456 V 14 w(table\(void\))114 1506 y Fa(f)163
1556 y Fb(unsigned)h(long)f(c;)163 1605 y(int)h(n,)g(k;)163
1705 y(for)g(\(n)g(=)g(0;)f(n)h(<)g(256;)f(n++\))h Fa(f)213
1755 y Fb(c)g(=)g(\(unsigned)f(long\))g(n;)213 1805 y(for)h(\(k)g(=)f
(0;)h(k)g(<)g(8;)f(k++\))h Fa(f)263 1855 y Fb(if)g(\(c)g(&)f(1\))h
Fa(f)313 1904 y Fb(c)g(=)g(0xedb88320L)e(\303)i(\(c)g(>>)g(1\);)263
1954 y Fa(g)g Fb(else)f Fa(f)313 2004 y Fb(c)h(=)g(c)f(>>)h(1;)263
2054 y Fa(g)213 2104 y(g)213 2153 y Fb(crc)p 290 2153
V 15 w(table[n])f(=)h(c;)163 2203 y Fa(g)163 2253 y Fb(crc)p
240 2253 V 15 w(table)p 380 2253 V 15 w(computed)f(=)h(1;)114
2303 y Fa(g)114 2402 y Fb(/*)188 2452 y(Update)g(a)g(running)f(crc)g
(with)h(the)g(bytes)f(buf[0..len-1])g(and)g(return)139
2502 y(the)g(updated)g(crc.)h(The)g(crc)f(should)h(be)f(initialized)g
(to)h(zero.)f(Pre-)h(and)139 2552 y(post-conditioning)e(\(one's)h
(complement\))g(is)h(performed)f(within)g(this)139 2602
y(function)g(so)g(it)h(shouldn't)f(be)h(done)f(by)h(the)g(caller.)f
(Usage)g(example:)188 2701 y(unsigned)h(long)f(crc)h(=)f(0L;)0
2869 y Fk(Deutsch)649 b(Informational)h([Page)11 b(10])p
eop
%%Page: 11 11
11 10 bop 0 46 a Fk(RFC)12 b(1952)463 b(GZIP)11 b(File)g(Format)h
(Speci\256cation)462 b(May)12 b(1996)188 195 y Fb(while)25
b(\(read)p 465 195 13 2 v 14 w(buffer\(buffer,)f(length\))g(!=)h(EOF\))
f Fa(f)238 245 y Fb(crc)h(=)g(update)p 540 245 V 14 w(crc\(crc,)f
(buffer,)g(length\);)188 295 y Fa(g)188 345 y Fb(if)h(\(crc)g(!=)f
(original)p 664 345 V 15 w(crc\))g(error\(\);)114 394
y(*/)114 444 y(unsigned)g(long)g(update)p 614 444 V 15
w(crc\(unsigned)f(long)i(crc,)512 494 y(unsigned)f(char)h(*buf,)f(int)h
(len\))114 544 y Fa(f)163 594 y Fb(unsigned)g(long)f(c)h(=)g(crc)f
(\303)h(0xffffffffL;)163 643 y(int)g(n;)163 743 y(if)g(\(!crc)p
365 743 V 15 w(table)p 505 743 V 14 w(computed\))213
793 y(make)p 315 793 V 15 w(crc)p 405 793 V 14 w(table\(\);)163
843 y(for)g(\(n)g(=)g(0;)f(n)h(<)g(len;)f(n++\))h Fa(f)213
892 y Fb(c)g(=)g(crc)p 390 892 V 15 w(table[\(c)f(\303)h(buf[n]\))f(&)h
(0xff])f(\303)h(\(c)g(>>)f(8\);)163 942 y Fa(g)163 992
y Fb(return)h(c)g(\303)f(0xffffffffL;)114 1042 y Fa(g)114
1142 y Fb(/*)g(Return)h(the)f(CRC)h(of)g(the)f(bytes)h(buf[0..len-1].)e
(*/)114 1191 y(unsigned)h(long)g(crc\(unsigned)g(char)h(*buf,)f(int)h
(len\))114 1241 y Fa(f)163 1291 y Fb(return)g(update)p
490 1291 V 14 w(crc\(0L,)f(buf,)h(len\);)114 1341 y Fa(g)0
2869 y Fk(Deutsch)650 b(Informational)g([Page)12 b(1)n(1])p
eop
%%Trailer
end
userdict /end-hook known{end-hook}if
%%EOF