%!PS-Adobe-2.0
%%Creator: dvipsk 5.55a Copyright 1986, 1994 Radical Eye Software
%%Title: rfc-gzip.ps
%%Pages: 12
%%PageOrder: Ascend
%%BoundingBox: 0 0 612 792
%%DocumentFonts: Times-Roman Times-Bold Times-Italic Courier
%%EndComments
%DVIPSCommandLine: dvips -D 300 -o gzip.ps gzip.dvi
%DVIPSParameters: dpi=300, compressed, comments removed
%DVIPSSource:  TeX output 1996.05.23:2046
%%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.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)1301
b(P)-5 b(.)12 b(Deutsch)0 252 y(Request)f(for)g(Comments:)k(1952)1049
b(Aladdin)10 b(Enterprises)0 308 y(Category:)k(Informational)1319
b(May)12 b(1996)377 479 y Fj(GZIP)18 b(\256le)f(format)g
(speci\256cation)g(version)g(4.3)0 704 y Fi(Status)e(of)g(This)g(Memo)0
836 y Fk(This)10 b(memo)j(provides)d(information)g(for)i(the)f
(Internet)g(community)m(.)16 b(This)10 b(memo)i(does)f(not)g(specify)g
(an)h(Internet)f(stan-)0 893 y(dard)g(of)g(any)g(kind.)k(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)e(on)i(the)g(validity)e
(of)i(any)h(Intellectual)e(Property)h(Rights)f(statements)g(contained)g
(in)h(this)0 1257 y(document.)0 1433 y Fi(Notices)0 1565
y Fk(Copyright)208 1564 y(c)196 1565 y Fh(\015)g Fk(1996)e(L.)h(Peter)h
(Deutsch)0 1651 y(Permission)h(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)8 b(into)g(other)i
(languages)f(and)g(incorporation)f(into)h(compilations,)g(provided)f
(that)h(the)h(copyright)e(notice)h(and)0 1764 y(this)g(notice)g(are)i
(preserved,)g(and)f(that)f(any)h(substantive)e(changes)i(or)g
(deletions)e(from)j(the)f(original)f(are)h(clearly)g(marked.)0
1850 y(A)i(pointer)f(to)g(the)h(latest)e(version)h(of)h(this)f(and)g
(related)h(documentation)e(in)i(HTML)f(format)i(can)f(be)g(found)f(at)h
(the)f(URL)0 1906 y Fg(<)p Fk(ftp://ftp.uu.net/graphics/)o(png)o(/docu)
o(ments/zl)o(ib/)o(zdoc-index)o(.html)p Fg(>)p Fk(.)0
2083 y Fi(Abstract)0 2217 y Fk(This)h(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 2273 y(utility)m(.)28
b(The)16 b(format)h(includes)e(a)h(cyclic)g(redundancy)f(check)i(value)
f(for)g(detecting)f(data)h(corruption.)29 b(The)16 b(format)0
2329 y(presently)c(uses)g(the)h(DEFLA)-5 b(TE)11 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 2386 y(methods.)j(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
2719 y(Deutsch)698 b(Informational)g([Page)12 b(1])p
eop
%%Page: 2 2
2 1 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 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(.)g(.)g(.)g
(.)64 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(.)g(.)g
(.)g(.)64 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(.)g(.)g(.)g(.)64 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(.)g(.)g(.)g(.)64 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(.)g(.)g(.)g(.)64
b(3)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(.)g(.)g(.)g(.)64
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(.)g(.)g(.)g(.)64
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(.)g(.)g(.)g(.)64 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(.)g(.)g(.)g(.)64 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(.)g(.)g(.)g(.)64 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(.)g(.)g(.)g(.)64
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(.)g(.)g(.)g(.)64
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(.)g(.)g(.)g(.)64
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(.)g(.)g(.)g(.)64 b(8)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(.)g(.)g(.)g(.)64
b(8)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(.)
g(.)g(.)g(.)64 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(.)g(.)g(.)g(.)64 b(9)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(.)g(.)g(.)g(.)64 b(9)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(.)g(.)g(.)g(.)64 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(.)g(.)g(.)g(.)42
b(10)0 1545 y Fi(1)60 b(Intr)o(oduction)0 1680 y Ff(1.1)50
b(Purpose)0 1796 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 1882 y Fh(\017)23 b Fk(Is)12 b(independent)f(of)i(CPU)g
(type,)g(operating)e(system,)i(\256le)g(system,)f(and)h(character)g
(set,)g(and)f(hence)h(can)g(be)g(used)114 1938 y(for)e(interchange;)68
2025 y Fh(\017)23 b Fk(Can)12 b(compress)f(or)h(decompress)g(a)g(data)f
(stream)h(\(as)g(opposed)f(to)g(a)h(randomly)f(accessible)g(\256le\))h
(to)g(produce)f(an-)114 2081 y(other)h(data)g(stream,)i(using)d(only)h
(an)h Fe(a)f(priori)f Fk(bounded)g(amount)i(of)f(intermediate)g
(storage,)h(and)f(hence)h(can)g(be)114 2137 y(used)d(in)h(data)g
(communications)f(or)h(similar)g(structures)f(such)h(as)g(Unix)f
(\256lters;)68 2224 y Fh(\017)23 b Fk(Compresses)10 b(data)g(with)f(ef)
o(\256ciency)i(comparable)g(to)f(the)g(best)f(currently)h(available)g
(general-purpose)f(compres-)114 2280 y(sion)h(methods,)h(and)g(in)f
(particular)h(considerably)e(better)i(than)g(the)g(\252compress\272)g
(program;)68 2366 y Fh(\017)23 b Fk(Can)11 b(be)g(implemented)g
(readily)g(in)g(a)g(manner)h(not)e(covered)h(by)g(patents,)g(and)g
(hence)g(can)h(be)f(practiced)g(freely;)68 2452 y Fh(\017)23
b Fk(Is)10 b(compatible)g(with)f(the)h(\256le)h(format)f(produced)g(by)
g(the)g(current)h(widely)e(used)h(gzip)f(utility)m(,)g(in)h(that)g
(conforming)114 2509 y(decompressors)g(will)g(be)h(able)h(to)e(read)i
(data)f(produced)f(by)h(the)g(existing)f(gzip)g(compressor)n(.)0
2594 y(The)h(data)g(format)h(de\256ned)f(by)g(this)f(speci\256cation)g
(does)h(not)f(attempt)h(to:)0 2719 y(Deutsch)698 b(Informational)g
([Page)12 b(2])p eop
%%Page: 3 3
3 2 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)68 195 y Fh(\017)23
b Fk(Provide)10 b(random)i(access)f(to)g(compressed)g(data;)68
282 y Fh(\017)23 b Fk(Compress)10 b(specialized)g(data)h(\(e.g.,)h
(raster)f(graphics\))f(as)h(well)f(as)h(the)g(best)f(currently)g
(available)g(specialized)g(al-)114 339 y(gorithms.)0
493 y Ff(1.2)50 b(Intended)12 b(audience)0 611 y Fk(This)e
(speci\256cation)g(is)h(intended)e(for)j(use)f(by)f(implementors)h(of)g
(software)f(to)h(compress)g(data)g(into)f(gzip)g(format)i(and/or)0
667 y(decompress)f(data)g(from)h(gzip)e(format.)0 754
y(The)g(text)f(of)i(the)e(speci\256cation)g(assumes)h(a)h(basic)e
(background)g(in)h(programming)g(at)g(the)g(level)f(of)h(bits)f(and)h
(other)g(prim-)0 811 y(itive)g(data)h(representations.)0
966 y Ff(1.3)50 b(Scope)0 1083 y Fk(The)12 b(speci\256cation)g
(speci\256es)g(a)h(compression)e(method)h(and)h(a)g(\256le)f(format)h
(\(the)f(latter)h(assuming)e(only)g(that)h(a)h(\256le)g(can)0
1140 y(store)e(a)i(sequence)e(of)h(arbitrary)g(bytes\).)k(It)c(does)g
(not)f(specify)g(any)h(particular)f(interface)h(to)f(a)i(\256le)f
(system)f(or)h(anything)0 1196 y(about)e(character)i(sets)f(or)g
(encodings)f(\(except)h(for)g(\256le)h(names)f(and)g(comments,)h(which)
e(are)i(optional\).)0 1351 y Ff(1.4)50 b(Compliance)0
1469 y Fk(Unless)8 b(otherwise)h(indicated)f(below)m(,)i(a)g(compliant)
e(decompressor)i(must)f(be)g(able)h(to)f(accept)h(and)f(decompress)h
(any)f(\256le)0 1525 y(that)e(conforms)g(to)g(all)h(the)f
(speci\256cations)f(presented)h(here;)i(a)f(compliant)e(compressor)h
(must)g(produce)h(\256les)f(that)g(conform)0 1581 y(to)k(all)g(the)g
(speci\256cations)f(presented)h(here.)16 b(The)11 b(material)h(in)f
(the)g(appendices)f(is)h(not)g(part)g(of)g(the)g(speci\256cation)g(per)
g(se)0 1638 y(and)g(is)g(not)f(relevant)h(to)g(compliance.)0
1793 y Ff(1.5)50 b(De\256nitions)11 b(of)h(terms)h(and)f(conventions)f
(used)0 1910 y Fk(byte:)j(8)d(bits)e(stored)h(or)h(transmitted)f(as)h
(a)g(unit)f(\(same)h(as)g(an)g(octet\).)k(\(For)c(this)f
(speci\256cation,)g(a)h(byte)g(is)f(exactly)g(8)h(bits,)0
1967 y(even)e(on)f(machines)h(which)f(store)h(a)g(character)h(on)e(a)h
(number)g(of)g(bits)f(dif)o(ferent)h(from)g(8.\))15 b(See)9
b(below)f(for)h(the)g(numbering)0 2023 y(of)i(bits)f(within)g(a)h
(byte.)0 2178 y Ff(1.6)50 b(Changes)12 b(fr)o(om)h(pr)o(evious)f
(versions)0 2296 y Fk(There)h(have)g(been)f(no)h(technical)f(changes)g
(to)g(the)g(gzip)h(format)g(since)f(version)g(4.1)g(of)h(this)f
(speci\256cation.)18 b(In)13 b(version)0 2352 y(4.2,)e(some)f
(terminology)e(was)i(changed,)g(and)g(the)g(sample)g(CRC)h(code)f(was)g
(rewritten)f(for)h(clarity)g(and)g(to)f(eliminate)g(the)0
2408 y(requirement)j(for)g(the)g(caller)g(to)f(do)h(pre-)g(and)g
(post-conditioni)o(ng.)j(V)-5 b(ersion)11 b(4.3)h(is)f(a)i(conversion)d
(of)j(the)e(speci\256cation)0 2465 y(to)g(RFC)h(style.)0
2719 y(Deutsch)698 b(Informational)g([Page)12 b(3])p
eop
%%Page: 4 4
4 3 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)0 195 y Fi(2)60
b(Detailed)13 b(speci\256cation)0 331 y Ff(2.1)50 b(Overall)12
b(conventions)0 448 y Fk(In)f(the)g(diagrams)g(below)m(,)g(a)h(box)e
(like)h(this:)114 535 y Fd(+---+)114 592 y(|)82 b(|)27
b(<--)h(the)g(vertical)i(bars)e(might)h(be)f(missing)114
648 y(+---+)0 735 y Fk(represents)11 b(one)g(byte;)f(a)h(box)g(like)g
(this:)114 822 y Fd(+==============)q(+)114 879 y(|)382
b(|)114 935 y(+==============)q(+)0 1022 y Fk(represents)11
b(a)g(variable)g(number)g(of)g(bytes.)0 1109 y(Bytes)g(stored)g(within)
f(a)i(computer)f(do)g(not)g(have)h(a)g(\252bit)f(order)r(\272,)g(since)
h(they)f(are)h(always)f(treated)g(as)h(a)g(unit.)j(However)n(,)0
1165 y(a)d(byte)f(considered)f(as)i(an)g(integer)e(between)i(0)f(and)g
(255)g(does)g(have)h(a)f(most-)h(and)f(least-signi\256cant)e(bit,)j
(and)f(since)g(we)0 1222 y(write)f(numbers)g(with)f(the)h
(most-signi\256cant)e(digit)h(on)g(the)h(left,)h(we)f(also)g(write)g
(bytes)f(with)g(the)h(most-signi\256cant)e(bit)i(on)0
1278 y(the)h(left.)16 b(In)11 b(the)g(diagrams)h(below)m(,)f(we)g
(number)h(the)f(bits)f(of)h(a)h(byte)f(so)g(that)g(bit)f(0)i(is)e(the)i
(least-signi\256cant)d(bit,)i(i.e.,)h(the)0 1335 y(bits)e(are)i
(numbered:)114 1434 y Fd(+--------+)114 1491 y(|76543210|)114
1547 y(+--------+)0 1647 y Fk(This)7 b(document)g(does)g(not)f(address)
i(the)f(issue)f(of)i(the)f(order)h(in)f(which)g(bits)f(of)i(a)g(byte)f
(are)h(transmitted)e(on)i(a)g(bit-sequential)0 1703 y(medium,)k(since)e
(the)h(data)g(format)h(described)f(here)g(is)g(byte-)g(rather)g(than)g
(bit-oriented.)0 1790 y(W)n(ithin)h(a)h(computer)n(,)h(a)f(number)h
(may)f(occupy)g(multiple)e(bytes.)20 b(All)13 b(multi-byte)e(numbers)i
(in)g(the)f(format)i(described)0 1847 y(here)d(are)h(stored)e(with)g
(the)h(least-signi\256cant)e(byte)i(\256rst)f(\(at)i(the)e(lower)h
(memory)h(address\).)i(For)e(example,)f(the)g(decimal)0
1903 y(number)g(520)g(is)f(stored)h(as:)223 1990 y Fd(0)218
b(1)114 2046 y(+--------+-----)q(---)q(+)114 2103 y(|00001000|00000)q
(010)q(|)114 2159 y(+--------+-----)q(---)q(+)141 2216
y(\303)g(\303)141 2272 y(|)g(|)141 2329 y(|)g(+)28 b(more)g
(significant)j(byte)d(=)f(2)h(x)g(256)141 2385 y(+)f(less)i
(significant)h(byte)e(=)g(8)0 2719 y Fk(Deutsch)698 b(Informational)g
([Page)12 b(4])p eop
%%Page: 5 5
5 4 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)0 195 y Ff(2.2)50
b(File)13 b(format)0 313 y Fk(A)g(gzip)f(\256le)h(consists)e(of)i(a)h
(series)e(of)h(\252members\272)h(\(compressed)f(data)g(sets\).)19
b(The)13 b(format)g(of)g(each)h(member)g(is)e(spec-)0
369 y(i\256ed)h(in)f(the)g(following)f(section.)19 b(The)12
b(members)i(simply)d(appear)i(one)g(after)g(another)f(in)g(the)h
(\256le,)g(with)f(no)g(additional)0 426 y(information)e(before,)i
(between,)f(or)g(after)h(them.)0 580 y Ff(2.3)50 b(Member)13
b(format)0 698 y Fk(Each)e(member)i(has)d(the)h(following)f(structure:)
114 785 y Fd(+---+---+---+--)q(-+-)q(--+-)q(--+-)q(--+)q(---+)q(---+)q
(---)q(+)114 841 y(|ID1|ID2|CM)30 b(|FLG|)138 b(MTIME)f(|XFL|OS)30
b(|)d(\(more-->\))114 898 y(+---+---+---+--)q(-+-)q(--+-)q(--+-)q(--+)q
(---+)q(---+)q(---)q(+)0 985 y Fk(\(if)11 b(FLG.FEXTRA)h(set\))114
1072 y Fd(+---+---+======)q(===)q(====)q(====)q(===)q(====)q(====)q
(===)q(==+)114 1128 y(|)27 b(XLEN)56 b(|...XLEN)29 b(bytes)g(of)f
("extra)h(field"...|)h(\(more-->\))114 1185 y(+---+---+======)q(===)q
(====)q(====)q(===)q(====)q(====)q(===)q(==+)0 1272 y
Fk(\(if)11 b(FLG.FNAME)h(set\))114 1359 y Fd(+==============)q(===)q
(====)q(====)q(===)q(====)q(====)q(===)q(==+)114 1415
y(|...original)30 b(file)f(name,)f(zero-terminat)q(ed.)q(..|)j
(\(more-->\))114 1472 y(+==============)q(===)q(====)q(====)q(===)q
(====)q(====)q(===)q(==+)0 1559 y Fk(\(if)11 b(FLG.FCOMMENT)h(set\))114
1646 y Fd(+==============)q(===)q(====)q(====)q(===)q(====)q(===+)114
1702 y(|...file)29 b(comment,)h(zero-terminated)q(...|)h(\(more-->\))
114 1759 y(+==============)q(===)q(====)q(====)q(===)q(====)q(===+)0
1846 y Fk(\(if)11 b(FLG.FHCRC)i(set\))114 1933 y Fd(+---+---+)114
1989 y(|)27 b(CRC16)i(|)114 2045 y(+---+---+)114 2145
y(+==============)q(===)q(====)q(==+)114 2201 y(|...compressed)i
(blocks...|)f(\(more-->\))114 2258 y(+==============)q(===)q(====)q
(==+)168 2357 y(0)82 b(1)g(2)g(3)h(4)f(5)g(6)g(7)114
2414 y(+---+---+---+--)q(-+-)q(--+-)q(--+-)q(--+)q(---+)114
2470 y(|)136 b(CRC32)i(|)f(ISIZE)g(|)114 2527 y(+---+---+---+--)q(-+-)q
(--+-)q(--+-)q(--+)q(---+)0 2719 y Fk(Deutsch)698 b(Informational)g
([Page)12 b(5])p eop
%%Page: 6 6
6 5 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)0 195 y Fc(2.3.1)45
b(Member)12 b(header)g(and)g(trailer)11 300 y(ID1)f(\(IDenti\256cation)
g(1\))11 385 y(ID2)g(\(IDenti\256cation)g(2\))114 459
y Fk(These)d(have)g(the)g(\256xed)h(values)e(ID1)h(=)h(31)f(\(0x1f,)g
Fd(\\)p Fk(037\),)i(ID2)e(=)g(139)g(\(0x8b,)g Fd(\\)p
Fk(213\),)h(to)f(identify)f(the)h(\256le)h(as)f(being)114
516 y(in)i(gzip)h(format.)11 601 y Fc(CM)g(\(Compr)o(ession)g(Method\))
114 675 y Fk(This)g(identi\256es)g(the)h(compression)f(method)g(used)h
(in)f(the)h(\256le.)19 b(CM)13 b(=)f(0-7)f(are)i(reserved.)18
b(CM)13 b(=)f(8)g(denotes)f(the)114 732 y(\252de\257ate\272)i
(compression)f(method,)h(which)g(is)f(the)h(one)f(customarily)g(used)h
(by)f(gzip)g(and)h(which)f(is)h(documented)114 788 y(elsewhere.)11
873 y Fc(FLG)f(\(FLaGs\))114 947 y Fk(This)e(\257ag)h(byte)g(is)g
(divided)e(into)h(individual)f(bits)h(as)h(follows:)214
1038 y Fd(bit)28 b(0)82 b(FTEXT)214 1094 y(bit)28 b(1)82
b(FHCRC)214 1151 y(bit)28 b(2)82 b(FEXTRA)214 1207 y(bit)28
b(3)82 b(FNAME)214 1264 y(bit)28 b(4)82 b(FCOMMENT)214
1320 y(bit)28 b(5)82 b(reserved)214 1377 y(bit)28 b(6)82
b(reserved)214 1433 y(bit)28 b(7)82 b(reserved)114 1524
y Fk(If)11 b(FTEXT)g(is)g(set,)g(the)g(\256le)g(is)g(probably)f(ASCII)i
(text.)i(This)c(is)h(an)g(optional)f(indication,)f(which)i(the)f
(compressor)114 1581 y(may)k(set)f(by)g(checking)g(a)h(small)f(amount)g
(of)h(the)f(input)f(data)i(to)f(see)g(whether)g(any)h(non-ASCII)g
(characters)g(are)114 1637 y(present.)g(In)c(case)h(of)f(doubt,)g
(FTEXT)g(is)g(cleared,)h(indicating)d(binary)i(data.)15
b(For)10 b(systems)g(which)f(have)h(dif)o(ferent)114
1693 y(\256le)g(formats)h(for)f(ascii)g(text)g(and)g(binary)g(data,)g
(the)h(decompressor)f(can)g(use)g(FTEXT)g(to)g(choose)g(the)g
(appropriate)114 1750 y(format.)21 b(W)l(e)13 b(deliberately)f(do)h
(not)f(specify)h(the)f(algorithm)g(used)h(to)f(set)h(this)f(bit,)h
(since)g(a)g(compressor)g(always)114 1806 y(has)c(the)h(option)e(of)i
(leaving)f(it)g(cleared)h(and)g(a)g(decompressor)f(always)h(has)f(the)h
(option)e(of)i(ignoring)e(it)h(and)h(letting)114 1863
y(some)h(other)g(program)g(handle)g(issues)f(of)h(data)g(conversion.)
114 1937 y(If)j(FHCRC)h(is)f(set,)g(a)g(CRC16)h(for)f(the)g(gzip)f
(header)h(is)g(present,)g(immediately)f(before)i(the)e(compressed)h
(data.)114 1994 y(The)9 b(CRC16)i(consists)d(of)i(the)g(two)f(least)h
(signi\256cant)e(bytes)h(of)h(the)g(CRC32)g(for)h(all)e(bytes)g(of)h
(the)g(gzip)f(header)i(up)114 2050 y(to)f(and)h(not)f(including)f(the)i
(CRC16.)k([The)c(FHCRC)i(bit)d(was)g(never)i(set)e(by)h(versions)e(of)i
(gzip)g(up)f(to)h(1.2.4,)g(even)114 2107 y(though)e(it)i(was)g
(documented)f(with)h(a)g(dif)o(ferent)g(meaning)g(in)g(gzip)g(1.2.4.])
114 2181 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
2256 y(If)h(FNAME)g(is)f(set,)h(an)f(original)g(\256le)g(name)i(is)e
(present,)h(terminated)f(by)g(a)h(zero)g(byte.)k(The)c(name)g(must)f
(consist)f(of)114 2312 y(ISO)i(8859-1)f(\(LA)-5 b(TIN-1\))10
b(characters;)h(on)e(operating)g(systems)h(using)e(EBCDIC)j(or)g(any)f
(other)f(character)i(set)f(for)114 2369 y(\256le)g(names,)g(the)g(name)
g(must)f(be)h(translated)f(to)g(the)g(ISO)h(LA)-5 b(TIN-1)9
b(character)i(set.)j(This)9 b(is)g(the)h(original)e(name)i(of)114
2425 y(the)h(\256le)g(being)g(compressed,)g(with)g(any)g(directory)f
(components)h(removed,)g(and,)h(if)f(the)g(\256le)h(being)e(compressed)
114 2482 y(is)g(on)h(a)h(\256le)g(system)f(with)f(case)i(insensitive)d
(names,)j(forced)f(to)g(lower)g(case.)16 b(There)c(is)f(no)g(original)f
(\256le)h(name)h(if)114 2538 y(the)g(data)g(was)h(compressed)f(from)h
(a)g(source)f(other)g(than)g(a)h(named)g(\256le;)g(for)g(example,)g(if)
g(the)f(source)g(was)h(stdin)114 2594 y(on)d(a)i(Unix)e(system,)h
(there)g(is)g(no)g(\256le)g(name.)0 2719 y(Deutsch)698
b(Informational)g([Page)12 b(6])p eop
%%Page: 7 7
7 6 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)114 195 y(If)f(FCOMMENT)h(is)f
(set,)g(a)h(zero-terminated)f(\256le)h(comment)f(is)g(present.)k(This)
10 b(comment)i(is)e(not)h(interpreted;)f(it)114 252 y(is)g(only)g
(intended)g(for)h(human)g(consumption.)i(The)e(comment)g(must)f
(consist)g(of)h(ISO)g(8859-1)f(\(LA)-5 b(TIN-1\))11 b(char)o(-)114
308 y(acters.)k(Line)c(breaks)g(should)e(be)j(denoted)e(by)h(a)g
(single)f(line)h(feed)g(character)h(\(10)f(decimal\).)114
384 y(Reserved)g(FLG)g(bits)f(must)h(be)g(zero.)11 470
y Fc(MTIME)h(\(Modi\256cation)f(TIME\))114 546 y Fk(This)d(gives)g(the)
h(most)g(recent)h(modi\256cation)e(time)h(of)h(the)f(original)f(\256le)
h(being)g(compressed.)14 b(The)9 b(time)g(is)g(in)g(Unix)114
602 y(format,)j(i.e.,)h(seconds)e(since)g(00:00:00)f(GMT)m(,)i(Jan.)17
b(1,)12 b(1970.)k(\(Note)11 b(that)g(this)g(may)h(cause)g(problems)f
(for)h(MS-)114 659 y(DOS)d(and)g(other)g(systems)f(that)h(use)g(local)g
(rather)h(than)e(Universal)h(time.\))14 b(If)c(the)f(compressed)g(data)
g(did)g(not)g(come)114 715 y(from)h(a)g(\256le,)h(MTIME)g(is)e(set)h
(to)f(the)h(time)g(at)g(which)f(compression)g(started.)14
b(MTIME)d(=)f(0)g(means)g(no)f(time)h(stamp)114 772 y(is)g(available.)
11 858 y Fc(XFL)i(\(eXtra)f(FLags\))114 934 y Fk(These)i(\257ags)g(are)
h(available)f(for)g(use)h(by)f(speci\256c)g(compression)f(methods.)21
b(The)14 b(\252de\257ate\272)g(method)f(\(CM)h(=)f(8\))114
990 y(sets)d(these)h(\257ags)g(as)g(follows:)214 1084
y Fd(XFL)28 b(=)f(2)h(-)f(compressor)j(used)f(maximum)g(compression,)
486 1140 y(slowest)h(algorithm)214 1196 y(XFL)e(=)f(4)h(-)f(compressor)
j(used)f(fastest)g(algorithm)11 1290 y Fc(OS)12 b(\(Operating)g
(System\))114 1366 y Fk(This)e(identi\256es)h(the)g(type)g(of)h(\256le)
g(system)f(on)g(which)g(compression)f(took)h(place.)17
b(This)10 b(may)i(be)g(useful)f(in)g(deter)o(-)114 1422
y(mining)f(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
1509 y Fb(0)25 b(-)g(FAT)g(filesystem)f(\(MS-DOS,)g(OS/2,)g(NT/Win32\))
263 1559 y(1)h(-)g(Amiga)263 1609 y(2)g(-)g(VMS)g(\(or)f(OpenVMS\))263
1659 y(3)h(-)g(Unix)263 1709 y(4)g(-)g(VM/CMS)263 1758
y(5)g(-)g(Atari)g(TOS)263 1808 y(6)g(-)g(HPFS)g(filesystem)f(\(OS/2,)g
(NT\))263 1858 y(7)h(-)g(Macintosh)263 1908 y(8)g(-)g(Z-System)263
1958 y(9)g(-)g(CP/M)239 2007 y(10)f(-)h(TOPS-20)239 2057
y(11)f(-)h(NTFS)g(filesystem)f(\(NT\))239 2107 y(12)g(-)h(QDOS)239
2157 y(13)f(-)h(Acorn)g(RISCOS)214 2207 y(255)f(-)h(unknown)11
2300 y Fc(XLEN)12 b(\(eXtra)g(LENgth\))114 2376 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 2462 y Fc(CRC32)f
(\(CRC-32\))114 2538 y Fk(This)j(contains)g(a)h(Cyclic)g(Redundancy)g
(Check)h(value)f(of)g(the)g(uncompressed)f(data)h(computed)g(according)
g(to)114 2594 y(CRC-32)d(algorithm)e(used)i(in)f(the)g(ISO)h(3309)f
(standard)g(and)g(in)g(section)g(8.1.1.6.2)g(of)h(ITU-T)g
(recommendation)0 2719 y(Deutsch)698 b(Informational)g([Page)12
b(7])p eop
%%Page: 8 8
8 7 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)114 195 y(V)-6 b(.42.)16
b(\(See)d(http://www)m(.iso)o(.ch)c(for)j(ordering)f(ISO)h(documents.)k
(See)c(gopher://info.itu.ch)d(for)j(an)f(online)g(ver)o(-)114
252 y(sion)f(of)h(ITU-T)g(V)-6 b(.42.\))11 349 y Fc(ISIZE)12
b(\(Input)g(SIZE\))114 436 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
589 y Fc(Extra)g(\256eld)46 b Fk(If)10 b(the)f(FLG.FEXTRA)h(bit)e(is)h
(set,)h(an)g(\252extra)g(\256eld\272)f(is)g(present)g(in)g(the)h
(header)n(,)g(with)f(total)f(length)h(XLEN)0 645 y(bytes.)14
b(It)e(consists)d(of)i(a)h(series)f(of)g(sub\256elds,)f(each)i(of)f
(the)g(form:)114 732 y Fd(+---+---+---+--)q(-+=)q(====)q(====)q(===)q
(====)q(====)q(===)q(====)q(====)q(===)q(+)114 789 y(|SI1|SI2|)57
b(LEN)e(|...)28 b(LEN)g(bytes)h(of)f(subfield)h(data)g(...|)114
845 y(+---+---+---+--)q(-+=)q(====)q(====)q(===)q(====)q(====)q(===)q
(====)q(====)q(===)q(+)0 932 y Fk(SI1)9 b(and)g(SI2)h(provide)e(a)i
(sub\256eld)e(ID,)i(typically)d(two)i(ASCII)h(letters)e(with)g(some)i
(mnemonic)f(value.)14 b(Jean-Loup)8 b(Gailly)0 989 y
Fg(<)p Fk([email protected])p Fg(>)h Fk(is)g(maintaining)e(a)i
(registry)g(of)g(sub\256eld)f(IDs;)h(please)g(send)f(him)h(any)g
(sub\256eld)g(ID)g(you)f(wish)0 1045 y(to)j(use.)k(Sub\256eld)c(IDs)g
(with)f(SI2)h(=)g(0)g(are)h(reserved)g(for)f(future)g(use.)k(The)c
(following)e(IDs)i(are)h(currently)f(de\256ned:)114 1132
y Fd(SI1)246 b(SI2)g(Data)114 1189 y(----------)57 b(----------)g(----)
114 1245 y(0x41)28 b(\('A'\))56 b(0x70)28 b(\('P'\))56
b(Apollo)29 b(file)f(type)h(information)0 1332 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 1485 y Fc(Compliance)45
b Fk(A)11 b(compliant)f(compressor)h(must)g(produce)g(\256les)g(with)f
(correct)i(ID1,)f(ID2,)h(CM,)g(CRC32,)g(and)g(ISIZE,)0
1542 y(but)f(may)i(set)f(all)f(the)h(other)g(\256elds)g(in)f(the)h
(\256xed-length)f(part)h(of)g(the)g(header)g(to)g(default)f(values)h
(\(255)f(for)i(OS,)f(0)g(for)h(all)0 1598 y(others\).)i(The)c
(compressor)g(must)f(set)h(all)g(reserved)g(bits)f(to)h(zero.)0
1685 y(A)j(compliant)e(decompressor)h(must)g(check)h(ID1,)g(ID2,)h(and)
e(CM,)i(and)e(provide)g(an)h(error)g(indication)d(if)j(any)f(of)h
(these)0 1742 y(have)f(incorrect)g(values.)21 b(It)14
b(must)f(examine)g(FEXTRA/XLEN,)g(FNAME,)h(FCOMMENT)g(and)f(FHCRC)h(at)
g(least)f(so)0 1798 y(it)g(can)g(skip)f(over)i(the)f(optional)e
(\256elds)i(if)g(they)g(are)h(present.)21 b(It)13 b(need)g(not)g
(examine)g(any)g(other)g(part)g(of)h(the)f(header)g(or)0
1855 y(trailer;)j(in)f(particular)n(,)g(a)h(decompressor)e(may)h
(ignore)g(FTEXT)f(and)h(OS)g(and)g(always)f(produce)h(binary)f(output,)
g(and)0 1911 y(still)c(be)i(compliant.)17 b(A)12 b(compliant)f
(decompressor)h(must)f(give)h(an)g(error)h(indication)d(if)h(any)h
(reserved)g(bit)g(is)f(non-zero,)0 1967 y(since)f(such)f(a)i(bit)e
(could)g(indicate)h(the)f(presence)i(of)f(a)g(new)g(\256eld)g(that)g
(would)f(cause)h(subsequent)e(data)i(to)g(be)g(interpreted)0
2024 y(incorrectly)m(.)0 2200 y Fi(3)60 b(Refer)o(ences)0
2334 y Fk([1])13 b(\252Information)f(Processing)g(-)g(8-bit)g
(single-byte)f(coded)h(graphic)g(character)i(sets)e(-)g(Part)h(1:)18
b(Latin)11 b(alphabet)h(No.1\272)0 2391 y(\(ISO)g(8859-1:1987\).)h(The)
f(ISO)f(8859-1)g(\(Latin-1\))f(character)i(set)f(is)g(a)h(superset)e
(of)i(7-bit)e(ASCII.)17 b(Files)11 b(de\256ning)f(this)0
2447 y(character)i(set)f(are)h(available)e(as)h(iso)p
588 2447 14 2 v 16 w(8859-1.*)f(in)h(ftp://ftp.uu.net/graph)o(ics/p)o
(ng/)o(documents)o(/)0 2534 y([2])g(ISO)h(3309)0 2719
y(Deutsch)698 b(Informational)g([Page)12 b(8])p eop
%%Page: 9 9
9 8 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)0 195 y([3])f(ITU-T)g
(recommendation)g(V)-6 b(.42)0 282 y([4])19 b(Deutsch,)g(L.P)-5
b(.,\252DEFLA)g(TE)19 b(Compressed)g(Data)f(Format)h
(Speci\256cation\272,)h(available)e(in)g(ftp://ftp.uu.net/pub)o(/)0
339 y(archiving/zip/doc/)0 426 y([5])11 b(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 513 y([6])k(Sarwate,)h(D.V)-6
b(.,)15 b(\252Computation)e(of)g(Cyclic)h(Redundancy)f(Checks)h(via)f
(T)m(able)g(Look-Up\272,)h(Communications)e(of)0 569
y(the)f(ACM,)h(31\(8\),)f(pp.1008-1013.)0 656 y([7])g(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 743 y([8])h
(ftp://ftp.adelaide.edu.au/pub/rocks)o(oft/)o(papers/crc)p
945 743 14 2 v 14 w(v3.txt,)f(describing)g(the)h(CRC)h(concept.)0
920 y Fi(4)60 b(Security)13 b(Considerations)0 1053 y
Fk(Any)e(data)g(compression)f(method)h(involves)e(the)i(reduction)f(of)
h(redundancy)g(in)f(the)h(data.)k(Consequently)m(,)10
b(any)h(corrup-)0 1110 y(tion)h(of)g(the)h(data)f(is)g(likely)f(to)i
(have)f(severe)h(ef)o(fects)g(and)g(be)f(dif)o(\256cult)g(to)g
(correct.)20 b(Uncompressed)12 b(text,)h(on)f(the)h(other)0
1166 y(hand,)e(will)f(probably)g(still)g(be)h(readable)g(despite)f(the)
h(presence)h(of)f(some)g(corrupted)g(bytes.)0 1253 y(It)g(is)f
(recommended)i(that)e(systems)g(using)f(this)h(data)h(format)g(provide)
f(some)h(means)g(of)g(validating)e(the)h(integrity)g(of)g(the)0
1310 y(compressed)h(data,)g(such)g(as)g(by)g(setting)f(and)h(checking)f
(the)h(CRC-32)h(check)f(value.)0 1486 y Fi(5)60 b(Acknowledgements)0
1620 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 1707
y(Jean-Loup)d(Gailly)f(designed)h(the)g(gzip)h(format)g(and)f(wrote,)i
(with)d(Mark)j(Adler)n(,)f(the)g(related)f(software)h(described)f(in)g
(this)0 1764 y(speci\256cation.)14 b(Glenn)d(Randers-Pehrson)g
(converted)f(this)g(document)h(to)g(RFC)h(and)f(HTML)g(format.)0
1940 y Fi(6)60 b(Author)q(')n(s)15 b(Addr)o(ess)0 2074
y Fk(L.)c(Peter)h(Deutsch)114 2161 y Fd(Aladdin)29 b(Enterprises)114
2217 y(203)f(Santa)g(Margarita)i(Ave.)114 2274 y(Menlo)e(Park,)h(CA)f
(94025)114 2387 y(Phone:)h(\(415\))f(322-0103)i(\(AM)e(only\))114
2443 y(FAX:)83 b(\(415\))28 b(322-1734)114 2500 y(EMail:)h
(<ghost@aladdin.)q(com>)0 2587 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:)0 2719 y(Deutsch)698 b(Informational)g([Page)12
b(9])p eop
%%Page: 10 10
10 9 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)114 195 y Fd(Jean-Loup)29
b(Gailly)g(<[email protected])q(i.mi)q(t.ed)q(u>)i(and)114
252 y(Mark)d(Adler)h(<madler@alumni.)q(cal)q(tech)q(.edu)q(>)0
339 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 426 y Fd(L.)27 b(Peter)i(Deutsch)g
(<ghost@aladd)q(in.c)q(om>)i(and)114 482 y(Glenn)d(Randers-Pehr)q(son)j
(<randeg@alumni.)q(rpi)q(.edu)q(>)0 659 y Fi(7)60 b(Appendix:)20
b(Jean-Loup)14 b(Gailly')n(s)f(gzip)h(utility)0 792 y
Fk(The)f(most)g(widely)f(used)g(implementation)g(of)h(gzip)g
(compression,)f(and)h(the)g(original)f(documentation)f(on)i(which)f
(this)0 849 y(speci\256cation)e(is)h(based,)h(were)g(created)g(by)f
(Jean-Loup)f(Gailly)g Fg(<)p Fk([email protected])p
Fg(>)p Fk(.)16 b(Since)c(this)e(implementa-)0 905 y(tion)g(is)h(a)h(de)
g(facto)f(standard,)g(we)h(mention)e(some)i(more)g(of)g(its)e(features)
i(here.)k(Again,)11 b(the)g(material)h(in)f(this)f(section)h(is)0
962 y(not)f(part)h(of)h(the)f(speci\256cation)f(per)h(se,)h(and)f
(implementations)e(need)i(not)g(follow)f(it)g(to)h(be)g(compliant.)0
1049 y(When)f(compressing)f(or)h(decompressing)f(a)h(\256le,)h(gzip)e
(preserves)h(the)g(protection,)f(ownership,)g(and)h(modi\256cation)f
(time)0 1105 y(attributes)k(on)i(the)f(local)h(\256le)g(system,)h
(since)e(there)h(is)f(no)h(provision)e(for)i(representing)e(protection)
h(attributes)f(in)h(the)0 1162 y(gzip)d(\256le)h(format)h(itself.)j
(Since)c(the)g(\256le)g(format)g(includes)e(a)j(modi\256cation)e(time,)
h(the)f(gzip)h(decompressor)f(provides)g(a)0 1218 y(command)g(line)e
(switch)g(that)h(assigns)e(the)i(modi\256cation)g(time)g(from)g(the)g
(\256le,)h(rather)g(than)e(the)h(local)g(modi\256cation)f(time)0
1275 y(of)i(the)g(compressed)g(input,)f(to)h(the)g(decompressed)g
(output.)0 1451 y Fi(8)60 b(Appendix:)20 b(Sample)14
b(CRC)h(Code)0 1585 y Fk(The)c(following)f(sample)i(code)f(represents)g
(a)h(practical)g(implementation)e(of)i(the)f(CRC)i(\(Cyclic)e
(Redundancy)g(Check\).)0 1641 y(\(See)h(also)f(ISO)g(3309)g(and)g
(ITU-T)g(V)-6 b(.42)11 b(for)g(a)h(formal)f(speci\256cation.\))0
1728 y(The)f(sample)g(code)h(is)f(in)f(the)h(ANSI)h(C)g(programming)f
(language.)k(Non)c(C)h(users)e(may)i(\256nd)f(it)g(easier)h(to)f(read)g
(with)g(these)0 1785 y(hints:)114 1865 y Fb(&)149 b(Bitwise)24
b(AND)h(operator.)114 1915 y(\303)149 b(Bitwise)24 b(exclusive-OR)g
(operator.)114 1965 y(>>)124 b(Bitwise)24 b(right)h(shift)f(operator.)g
(When)h(applied)f(to)h(an)288 2015 y(unsigned)f(quantity,)g(as)h(here,)
f(right)h(shift)f(inserts)g(zero)288 2064 y(bit\(s\))g(at)h(the)g
(left.)114 2114 y(!)149 b(Logical)24 b(NOT)h(operator.)114
2164 y(++)124 b("n++")24 b(increments)g(the)h(variable)f(n.)114
2214 y(0xNNN)49 b(0x)25 b(introduces)f(a)g(hexadecimal)g(\(base)h(16\))
f(constant.)288 2264 y(Suffix)g(L)h(indicates)f(a)h(long)g(value)f
(\(at)h(least)f(32)h(bits\).)114 2363 y(/*)f(Table)h(of)g(CRCs)f(of)h
(all)f(8-bit)h(messages.)f(*/)114 2413 y(unsigned)g(long)g(crc)p
539 2413 13 2 v 15 w(table[256];)114 2513 y(/*)g(Flag:)h(has)f(the)h
(table)f(been)h(computed?)f(Initially)g(false.)g(*/)114
2563 y(int)g(crc)p 290 2563 V 15 w(table)p 430 2563 V
14 w(computed)h(=)f(0;)0 2719 y Fk(Deutsch)687 b(Informational)g([Page)
11 b(10])p eop
%%Page: 11 11
11 10 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)114 195 y Fb(/*)24
b(Make)h(the)g(table)f(for)h(a)f(fast)h(CRC.)f(*/)114
245 y(void)g(make)p 340 245 13 2 v 15 w(crc)p 430 245
V 14 w(table\(void\))114 295 y Fa(f)163 345 y Fb(unsigned)h(long)f(c;)
163 394 y(int)h(n,)g(k;)163 494 y(for)g(\(n)g(=)g(0;)f(n)h(<)g(256;)f
(n++\))h Fa(f)213 544 y Fb(c)g(=)g(\(unsigned)f(long\))g(n;)213
594 y(for)h(\(k)g(=)f(0;)h(k)g(<)g(8;)f(k++\))h Fa(f)263
643 y Fb(if)g(\(c)g(&)f(1\))h Fa(f)313 693 y Fb(c)g(=)g(0xedb88320L)e
(\303)i(\(c)g(>>)g(1\);)263 743 y Fa(g)g Fb(else)f Fa(f)313
793 y Fb(c)h(=)g(c)f(>>)h(1;)263 843 y Fa(g)213 892 y(g)213
942 y Fb(crc)p 290 942 V 15 w(table[n])f(=)h(c;)163 992
y Fa(g)163 1042 y Fb(crc)p 240 1042 V 15 w(table)p 380
1042 V 15 w(computed)f(=)h(1;)114 1092 y Fa(g)114 1191
y Fb(/*)188 1241 y(Update)g(a)g(running)f(crc)g(with)h(the)g(bytes)f
(buf[0..len-1])g(and)g(return)139 1291 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
1341 y(post-conditioning)e(\(one's)h(complement\))g(is)h(performed)f
(within)g(this)139 1391 y(function)g(so)g(it)h(shouldn't)f(be)h(done)f
(by)h(the)g(caller.)f(Usage)g(example:)188 1490 y(unsigned)h(long)f
(crc)h(=)f(0L;)188 1590 y(while)h(\(read)p 465 1590 V
14 w(buffer\(buffer,)f(length\))g(!=)h(EOF\))f Fa(f)238
1640 y Fb(crc)h(=)g(update)p 540 1640 V 14 w(crc\(crc,)f(buffer,)g
(length\);)188 1689 y Fa(g)188 1739 y Fb(if)h(\(crc)g(!=)f(original)p
664 1739 V 15 w(crc\))g(error\(\);)114 1789 y(*/)114
1839 y(unsigned)g(long)g(update)p 614 1839 V 15 w(crc\(unsigned)f(long)
i(crc,)512 1889 y(unsigned)f(char)h(*buf,)f(int)h(len\))114
1939 y Fa(f)163 1988 y Fb(unsigned)g(long)f(c)h(=)g(crc)f(\303)h
(0xffffffffL;)163 2038 y(int)g(n;)163 2138 y(if)g(\(!crc)p
365 2138 V 15 w(table)p 505 2138 V 14 w(computed\))213
2188 y(make)p 315 2188 V 15 w(crc)p 405 2188 V 14 w(table\(\);)163
2237 y(for)g(\(n)g(=)g(0;)f(n)h(<)g(len;)f(n++\))h Fa(f)213
2287 y Fb(c)g(=)g(crc)p 390 2287 V 15 w(table[\(c)f(\303)h(buf[n]\))f
(&)h(0xff])f(\303)h(\(c)g(>>)f(8\);)163 2337 y Fa(g)163
2387 y Fb(return)h(c)g(\303)f(0xffffffffL;)114 2437 y
Fa(g)0 2719 y Fk(Deutsch)688 b(Informational)f([Page)12
b(1)n(1])p eop
%%Page: 12 12
12 11 bop 0 46 a Fk(RFC)12 b(1952)500 b(GZIP)11 b(File)h(Format)f
(Speci\256cation)500 b(May)12 b(1996)114 195 y Fb(/*)24
b(Return)h(the)f(CRC)h(of)g(the)f(bytes)h(buf[0..len-1].)e(*/)114
245 y(unsigned)h(long)g(crc\(unsigned)g(char)h(*buf,)f(int)h(len\))114
295 y Fa(f)163 345 y Fb(return)g(update)p 490 345 13
2 v 14 w(crc\(0L,)f(buf,)h(len\);)114 394 y Fa(g)0 2719
y Fk(Deutsch)687 b(Informational)g([Page)11 b(12])p eop
%%Trailer
end
userdict /end-hook known{end-hook}if
%%EOF