%!PS-Adobe-2.0 %%Creator: dvipsk 5.55a Copyright 1986, 1994 Radical Eye Software %%Title: rfc-zlib.ps %%Pages: 10 %%PageOrder: Ascend %%BoundingBox: 0 0 612 792 %%DocumentFonts: Times-Roman Times-Bold Times-Italic Courier %%EndComments %DVIPSCommandLine: dvips -D 300 -o zlib.ps zlib.dvi %DVIPSParameters: dpi=300, compressed, comments removed %DVIPSSource: TeX output 1996.05.23:2052 %%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 (zlib.dvi) @start /Fa 2 104 df102 DI E /Fb 133[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 3[25 1[25 25 25 25 2[25 25 1[25 5[25 25 25 1[25 25 2[25 25 25 25 25 3[25 25 1[25 25 25 25 25 25 25 25 25 25 25 25 1[25 25 1[25 25 25 33[{}64 41.666668 /Courier rf /Fc 80[25 53[23 2[23 25 15 18 20 1[25 23 25 38 13 25 1[13 25 23 15 20 25 20 1[23 10[33 1[30 1[33 1[28 35 33 43 30 2[18 1[35 28 30 33 33 1[33 13[23 23 4[15 3[15 15 40[{}41 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 8[27 1[27 1[27 27 27 1[27 27 27 27 27 27 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 40[{}67 45.624989 /Courier rf /Fe 81[28 55[25 28 17 19 22 1[28 25 28 41 14 2[14 28 25 17 22 28 22 1[25 12[33 28 2[30 39 5[19 4[36 36 1[36 8[25 1[25 25 25 25 25 25 2[12 17 45[{}36 50.000000 /Times-Bold rf /Ff 141[18 1[23 23 5[13 7[23 97[{}5 45.624989 /Times-Italic rf /Fg 2 63 df60 D62 D E /Fh 2 16 df13 D15 D E /Fi 81[33 52[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 3[23 1[47 1[40 43 43 1[43 6[20 30 30 30 30 30 30 30 30 30 9[20 39[{}45 59.999973 /Times-Bold rf /Fj 81[40 55[36 1[20 28 24 1[36 36 36 56 3[20 3[32 36 32 1[32 6[44 6[40 6[44 2[24 2[40 1[52 48 48 14[36 4[18 46[{}24 72.000000 /Times-Roman rf /Fk 69[20 10[25 25 3[20 47[20 23 23 33 23 23 13 18 15 23 23 23 23 35 13 23 13 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 33 18 15 33 33 25 28 33 30 30 33 3[26 1[13 13 23 23 23 23 23 23 23 23 23 23 13 11 15 11 26 23 15 15 15 35 38[{}80 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(1950)1049 b(Aladdin)10 b(Enterprises)0 308 y(Category:)k(Informational)1308 b(J-L.)11 b(Gailly)1791 364 y(Info-ZIP)1764 421 y(May)h(1996)155 587 y Fj(ZLIB)17 b(Compressed)g(Data)g(Format)h(Speci\256cation)e (version)h(3.3)0 807 y Fi(Status)e(of)g(This)g(Memo)0 939 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 996 y(dard)g(of)g(any)g(kind.)k(Distribution)8 b(of)j(this)f(memo)i(is)f(unlimited.)0 1170 y Fi(IESG)k(Note:)0 1302 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 1358 y(document.)0 1532 y Fi(Notices)0 1664 y Fk(Copyright)208 1663 y(c)196 1664 y Fh(\015)g Fk(1996)e(L.)h(Peter)h (Deutsch)e(and)h(Jean-Loup)g(Gailly)0 1749 y(Permission)i(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 1806 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 1862 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 1947 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 2004 y Fg()p Fk(.)0 2179 y Fi(Abstract)0 2312 y Fk(This)g(speci\256cation)g(de\256nes)h(a)g(lossless)e (compressed)i(data)g(format.)18 b(The)12 b(data)g(can)g(be)g(produced)f (or)h(consumed,)g(even)0 2369 y(for)e(an)f(arbitrarily)f(long)h (sequentially)e(presented)i(input)f(data)h(stream,)i(using)d(only)g(an) i Ff(a)f(priori)f Fk(bounded)g(amount)h(of)h(in-)0 2425 y(termediate)e(storage.)14 b(The)9 b(format)f(presently)g(uses)f(the)i (DEFLA)-5 b(TE)7 b(compression)g(method)h(but)g(can)h(be)f(easily)g (extended)0 2482 y(to)j(use)g(other)g(compression)g(methods.)16 b(It)11 b(can)h(be)f(implemented)g(readily)g(in)g(a)h(manner)g(not)f (covered)h(by)f(patents.)k(This)0 2538 y(speci\256cation)c(also)h (de\256nes)h(the)f(ADLER-32)g(checksum)g(\(an)h(extension)e(and)h (improvement)g(of)h(the)f(Fletcher)h(check-)0 2594 y(sum\),)f(used)e (for)i(detection)e(of)h(data)g(corruption,)f(and)h(provides)f(an)h (algorithm)f(for)i(computing)e(it.)0 2719 y(Deutsch)g(&)i(Gailly)612 b(Informational)g([Page)12 b(1])p eop %%Page: 2 2 2 1 bop 0 46 a Fk(RFC)12 b(1950)374 b(ZLIB)12 b(Compressed)f(Data)g (Format)h(Speci\256cation)374 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(2)68 581 y(1.5)82 b(De\256nitions)9 b(of)i(terms)h(and)f(conventions) e(used)26 b(.)d(.)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(Data)12 b(format)41 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(4)68 863 y(2.3)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(6)0 919 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(6)0 976 y(4)104 b(Source)12 b(code)35 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(6)0 1032 y(5)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(7)0 1089 y(6)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(7)0 1145 y(7)104 b(Authors')10 b(Addresses)35 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(7)0 1202 y(8)104 b(Appendix:)13 b(Rationale)h(.)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(8)68 1258 y(8.1)70 b(Preset)12 b(dictionaries)25 b(.)e(.)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)68 1315 y(8.2)70 b(The)11 b(Adler)o(-32)g(algorithm)29 b(.)23 b(.)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 1371 y(9)104 b(Appendix:)13 b(Sample)f(code)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(8)0 1548 y Fi(1)c(Intr)o(oduction)0 1683 y Fe(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 1900 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 1957 y(for)e(interchange;)68 2044 y Fh(\017)23 b Fk(Can)13 b(be)f(produced)g(or)g(consumed,)h(even)g(for)f(an)h(arbitrarily)e (long)h(sequentially)e(presented)i(input)f(data)h(stream,)114 2100 y(using)f(only)h(an)g Ff(a)h(priori)e Fk(bounded)g(amount)i(of)f (intermediate)h(storage,)f(and)h(hence)g(can)g(be)g(used)f(in)g(data)h (com-)114 2156 y(munications)c(or)i(similar)g(structures)f(such)h(as)g (Unix)f(\256lters;)68 2243 y Fh(\017)23 b Fk(Can)11 b(use)g(a)h(number) f(of)g(dif)o(ferent)g(compression)f(methods;)68 2330 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)m(.)0 2430 y(The)g(data)g(format)h(de\256ned)f(by)g (this)f(speci\256cation)g(does)h(not)f(attempt)h(to)f(allow)h(random)g (access)g(to)g(compressed)g(data.)0 2719 y(Deutsch)f(&)i(Gailly)612 b(Informational)g([Page)12 b(2])p eop %%Page: 3 3 3 2 bop 0 46 a Fk(RFC)12 b(1950)374 b(ZLIB)12 b(Compressed)f(Data)g (Format)h(Speci\256cation)374 b(May)12 b(1996)0 195 y Fe(1.2)50 b(Intended)12 b(audience)0 311 y Fk(This)f(speci\256cation)f (is)i(intended)e(for)i(use)f(by)h(implementors)f(of)g(software)h(to)f (compress)h(data)f(into)g(zlib)g(format)h(and/or)0 367 y(decompress)f(data)g(from)h(zlib)e(format.)0 453 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 509 y(itive)g(data)h(representations.)0 661 y Fe(1.3)50 b(Scope)0 776 y Fk(The)13 b(speci\256cation)e(speci\256es)i(a)g (compressed)g(data)f(format)i(that)e(can)h(be)g(used)f(for)h(in-memory) g(compression)f(of)h(a)g(se-)0 833 y(quence)e(of)g(arbitrary)g(bytes.)0 984 y Fe(1.4)50 b(Compliance)0 1100 y Fk(Unless)7 b(otherwise)h (indicated)f(below)m(,)h(a)h(compliant)e(decompressor)h(must)g(be)h (able)f(to)g(accept)h(and)f(decompress)g(any)g(data)0 1157 y(set)h(that)g(conforms)g(to)g(all)g(the)g(speci\256cations)f (presented)g(here;)i(a)g(compliant)e(compressor)h(must)g(produce)g (data)g(sets)g(that)0 1213 y(conform)i(to)g(all)g(the)g (speci\256cations)f(presented)g(here.)0 1365 y Fe(1.5)63 b(De\256nitions)11 b(of)h(terms)h(and)f(conventions)f(used)0 1480 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 1537 y(even)d(on)g(machines)h(which) e(store)h(a)h(character)g(on)f(a)h(number)f(of)h(bits)e(dif)o(ferent)h (from)h(8.\))15 b(See)9 b(below)m(,)f(for)h(the)f(numbering)0 1593 y(of)j(bits)f(within)g(a)h(byte.)0 1745 y Fe(1.6)50 b(Changes)12 b(fr)o(om)h(pr)o(evious)f(versions)0 1861 y Fk(V)-5 b(ersion)11 b(3.1)g(was)h(the)f(\256rst)g(public)g(release)h (of)f(this)g(speci\256cation.)k(In)d(version)e(3.2,)i(some)g (terminology)e(was)i(changed)0 1917 y(and)d(the)f(Adler)o(-32)h(sample) g(code)g(was)f(rewritten)h(for)g(clarity)m(.)14 b(In)9 b(version)f(3.3,)i(the)e(support)g(for)h(a)g(preset)g(dictionary)e(was) 0 1974 y(introduced,)j(and)h(the)g(speci\256cation)f(was)h(converted)g (to)g(RFC)h(style.)0 2147 y Fi(2)60 b(Detailed)13 b(speci\256cation)0 2281 y Fe(2.1)50 b(Overall)12 b(conventions)0 2396 y Fk(In)f(the)g(diagrams)g(below)m(,)g(a)h(box)e(like)h(this:)114 2482 y Fd(+---+)114 2538 y(|)82 b(|)27 b(\))114 2206 y(+---+---+)0 2293 y Fk(\(if)11 b(FLG.FDICT)h(set\))168 2380 y Fd(0)82 b(1)g(2)g(3)114 2436 y(+---+---+---+--)q(-+)114 2493 y(|)136 b(DICTID)111 b(|)82 b(\(more-->\))114 2549 y(+---+---+---+--)q(-+)0 2719 y Fk(Deutsch)10 b(&)i(Gailly)612 b(Informational)g([Page)12 b(4])p eop %%Page: 5 5 5 4 bop 0 46 a Fk(RFC)12 b(1950)374 b(ZLIB)12 b(Compressed)f(Data)g (Format)h(Speci\256cation)374 b(May)12 b(1996)114 195 y Fd(+==============)q(===)q(====)q(+---)q(+--)q(-+--)q(-+--)q(-+)114 252 y(|...compressed)31 b(data...|)111 b(ADLER32)g(|)114 308 y(+==============)q(===)q(====)q(+---)q(+--)q(-+--)q(-+--)q(-+)0 407 y Fk(Any)11 b(data)g(which)f(may)i(appear)f(after)h(ADLER32)e(are)i (not)f(part)g(of)g(the)g(zlib)f(stream.)11 506 y Fc(CMF)h(\(Compr)o (ession)g(Method)h(and)f(\257ags\))114 582 y Fk(This)h(byte)g(is)g (divided)g(into)g(a)h(4-bit)f(compression)g(method)h(and)f(a)i(4-bit)e (information)f(\256eld)i(depending)f(on)g(the)114 639 y(compression)e(method.)214 733 y Fd(bits)28 b(0)g(to)f(3)55 b(CM)137 b(Compression)30 b(method)214 790 y(bits)e(4)g(to)f(7)55 b(CINFO)h(Compression)30 b(info)11 885 y Fc(CM)11 b(\(Compr)o(ession)g (method\))114 961 y Fk(This)h(identi\256es)h(the)h(compression)e (method)i(used)f(in)g(the)h(\256le.)23 b(CM)15 b(=)f(8)f(denotes)g(the) h(\252de\257ate\272)g(compression)114 1018 y(method)d(with)g(a)i (window)d(size)i(up)g(to)f(32K.)h(This)f(is)h(the)g(method)f(used)h(by) f(gzip)h(and)g(PNG)g(\(see)g(references)h([1])114 1074 y(and)f([2])g(in)g(Chapter)h(3,)g(below)m(,)f(for)g(the)h(reference)g (documents\).)18 b(CM)13 b(=)g(15)f(is)f(reserved.)19 b(It)13 b(might)e(be)i(used)f(in)114 1131 y(a)h(future)f(version)g(of)h (this)f(speci\256cation)f(to)i(indicate)f(the)g(presence)h(of)g(an)g (extra)g(\256eld)g(before)g(the)f(compressed)114 1187 y(data.)11 1274 y Fc(CINFO)f(\(Compr)o(ession)g(info\))114 1350 y Fk(For)d(CM)h(=)e(8,)i(CINFO)g(is)e(the)h(base-2)f(logarithm)g (of)h(the)g(LZ77)f(window)f(size,)j(minus)e(eight)g(\(CINFO=7)h (indicates)114 1407 y(a)13 b(32K)g(window)g(size\).)22 b(V)-5 b(alues)13 b(of)g(CINFO)h(above)f(7)h(are)g(not)f(allowed)f(in)h (this)g(version)f(of)i(the)f(speci\256cation.)114 1463 y(CINFO)e(is)g(not)f(de\256ned)i(in)e(this)g(speci\256cation)h(for)g (CM)h(not)e(equal)h(to)g(8.)11 1550 y Fc(FLG)h(\(FLaGs\))114 1627 y Fk(This)e(\257ag)h(byte)g(is)g(divided)e(as)j(follows:)214 1721 y Fd(bits)28 b(0)g(to)f(4)55 b(FCHECK)h(\(check)29 b(bits)g(for)f(CMF)g(and)g(FLG\))214 1778 y(bit)55 b(5)191 b(FDICT)83 b(\(preset)30 b(dictionary\))214 1834 y(bits)e(6)g(to)f(7)55 b(FLEVEL)h(\(compression)31 b(level\))114 1929 y Fk(The)8 b(FCHECK)h(value)f(must)g(be)h(such)f(that)g(CMF)i(and)e(FLG,)h(when)f (viewed)g(as)h(a)g(16-bit)e(unsigned)g(integer)h(stored)114 1986 y(in)i(MSB)j(order)e(\(CMF*256)g(+)g(FLG\),)h(is)f(a)g(multiple)f (of)h(31.)11 2072 y Fc(FDICT)g(\(Pr)o(eset)h(dictionary\))114 2149 y Fk(If)d(FDICT)g(is)g(set,)g(a)g(DICT)g(dictionary)e (identi\256er)i(is)f(present)g(immediately)g(after)i(the)e(FLG)h(byte.) 14 b(The)9 b(dictionary)114 2205 y(is)k(a)i(sequence)f(of)g(bytes)f (which)h(are)h(initially)d(fed)i(to)g(the)g(compressor)f(without)g (producing)f(any)i(compressed)114 2262 y(output.)23 b(DICT)15 b(is)f(the)g(Adler)o(-32)g(checksum)g(of)h(this)e(sequence)h(of)h (bytes)f(\(see)g(the)h(de\256nition)e(of)h(ADLER32)114 2318 y(below\).)h(The)d(decompressor)f(can)g(use)h(this)e(identi\256er) h(to)g(determine)g(which)g(dictionary)f(has)h(been)g(used)g(by)g(the) 114 2375 y(compressor)n(.)11 2461 y Fc(FLEVEL)i(\(Compr)o(ession)d (level\))114 2538 y Fk(These)j(\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 2594 y(sets)d(these)h(\257ags)g(as)g(follows:)0 2719 y(Deutsch)f(&)i(Gailly) 612 b(Informational)g([Page)12 b(5])p eop %%Page: 6 6 6 5 bop 0 46 a Fk(RFC)12 b(1950)374 b(ZLIB)12 b(Compressed)f(Data)g (Format)h(Speci\256cation)374 b(May)12 b(1996)214 195 y Fd(0)27 b(-)h(compressor)i(used)e(fastest)h(algorithm)214 252 y(1)e(-)h(compressor)i(used)e(fast)g(algorithm)214 308 y(2)f(-)h(compressor)i(used)e(default)h(algorithm)214 364 y(3)e(-)h(compressor)i(used)e(maximum)h(compression,)i(slowest)e (algorithm)114 460 y Fk(The)11 b(information)f(in)h(FLEVEL)f(is)h(not)g (needed)g(for)h(decompression;)d(it)i(is)g(there)g(to)g(indicate)g(if)g (recompression)114 516 y(might)f(be)h(worthwhile.)11 603 y Fc(compr)o(essed)h(data)114 680 y Fk(For)j(compression)e(method)i (8,)g(the)g(compressed)f(data)h(is)f(stored)g(in)g(the)h(de\257ate)g (compressed)f(data)h(format)g(as)114 737 y(described)10 b(in)h(the)g(document)g(\252DEFLA)-5 b(TE)10 b(Compressed)h(Data)h (Format)f(Speci\256cation\272)g(by)g(L.)h(Peter)g(Deutsch.)114 793 y(\(See)g(reference)g([3])g(in)e(Chapter)i(3,)f(below\))114 870 y(Other)f(compressed)h(data)h(formats)f(are)h(not)e(speci\256ed)h (in)g(this)f(version)g(of)h(the)g(zlib)g(speci\256cation.)11 957 y Fc(ADLER32)g(\(Adler)n(-32)h(checksum\))114 1034 y Fk(This)f(contains)g(a)h(checksum)g(value)g(of)g(the)g(uncompressed)f (data)h(\(excluding)f(any)h(dictionary)f(data\))h(computed)114 1090 y(according)c(to)g(Adler)o(-32)g(algorithm.)13 b(This)8 b(algorithm)g(is)g(a)h(32-bit)e(extension)g(and)i(improvement)f(of)h (the)f(Fletcher)114 1147 y(algorithm,)f(used)g(in)g(the)g(ITU-T)g (X.224)g(/ISO)h(8073)e(standard.)14 b(See)8 b(references)g([4])g(and)f ([5])h(in)f(Chapter)g(3,)i(below\))114 1234 y(Adler)o(-32)f(is)h (composed)g(of)g(two)f(sums)h(accumulated)g(per)h(byte:)j(s1)c(is)f (the)h(sum)g(of)h(all)f(bytes,)g(s2)f(is)h(the)g(sum)g(of)h(all)114 1290 y(s1)e(values.)14 b(Both)8 b(sums)g(are)i(done)e(modulo)f(65521.) 14 b(s1)8 b(is)g(initialized)f(to)h(1,)h(s2)g(to)f(zero.)15 b(The)8 b(Adler)o(-32)g(checksum)114 1347 y(is)i(stored)h(as)g (s2*65536)e(+)i(s1)g(in)g(most-signi\256cant-byte)d(\256rst)j (\(network\))g(order)n(.)0 1501 y Fe(2.3)50 b(Compliance)0 1619 y Fk(A)9 b(compliant)g(compressor)g(must)g(produce)g(streams)g (with)f(correct)i(CMF)l(,)h(FLG)f(and)f(ADLER32,)g(but)g(need)g(not)g (support)0 1675 y(preset)g(dictionaries.)k(When)c(the)g(zlib)f(data)h (format)h(is)f(used)f(as)i(part)f(of)g(another)g(standard)f(data)h (format,)i(the)d(compressor)0 1732 y(may)j(use)e(only)g(preset)h (dictionaries)f(that)g(are)i(speci\256ed)e(by)h(this)f(other)h(data)g (format.)15 b(If)c(this)d(other)i(format)h(does)e(not)g(use)0 1788 y(the)i(preset)g(dictionary)e(feature,)j(the)f(compressor)g(must)g (not)f(set)h(the)g(FDICT)h(\257ag.)0 1875 y(A)h(compliant)g (decompressor)g(must)f(check)i(CMF)l(,)h(FLG,)f(and)f(ADLER32,)g(and)g (provide)g(an)g(error)h(indication)d(if)i(any)0 1932 y(of)h(these)f(have)h(incorrect)f(values.)22 b(A)14 b(compliant)f (decompressor)g(must)g(give)g(an)h(error)g(indication)e(if)i(CM)g(is)f (not)g(one)0 1988 y(of)e(the)h(values)e(de\256ned)i(in)f(this)f (speci\256cation)g(\(only)h(the)g(value)g(8)h(is)f(permitted)f(in)h (this)g(version\),)g(since)g(another)g(value)0 2045 y(could)h(indicate) g(the)g(presence)h(of)f(new)h(features)g(that)f(would)f(cause)i (subsequent)e(data)h(to)g(be)h(interpreted)f(incorrectly)m(.)0 2101 y(A)i(compliant)e(decompressor)i(must)f(give)g(an)h(error)g (indication)e(if)h(FDICT)h(is)g(set)f(and)g(DICTID)h(is)g(not)e(the)i (identi\256er)0 2158 y(of)f(a)f(known)g(preset)g(dictionary)m(.)18 b(A)12 b(decompressor)h(may)g(ignore)e(FLEVEL)h(and)h(still)d(be)j (compliant.)18 b(When)13 b(the)f(zlib)0 2214 y(data)d(format)h(is)e (being)h(used)f(as)i(a)f(part)g(of)g(another)g(standard)f(format,)j(a)e (compliant)f(decompressor)h(must)g(support)f(all)g(the)0 2271 y(preset)k(dictionaries)f(speci\256ed)i(by)f(the)g(other)h (format.)20 b(When)12 b(the)g(other)h(format)g(does)f(not)g(use)g(the)g (preset)h(dictionary)0 2327 y(feature,)f(a)f(compliant)g(decompressor)f (must)h(reject)h(any)f(stream)g(in)g(which)f(the)h(FDICT)h(\257ag)f(is) g(set.)0 2719 y(Deutsch)f(&)i(Gailly)612 b(Informational)g([Page)12 b(6])p eop %%Page: 7 7 7 6 bop 0 46 a Fk(RFC)12 b(1950)374 b(ZLIB)12 b(Compressed)f(Data)g (Format)h(Speci\256cation)374 b(May)12 b(1996)0 195 y Fi(3)60 b(Refer)o(ences)0 329 y Fk([1])9 b(Deutsch,)g(L.P)-5 b(.,\252GZIP)10 b(Compressed)f(Data)g(Format)g(Speci\256cation\272,)h (available)e(in)h(ftp://ftp.uu.net/pu)o(b/archiv)o(ing)o(/)0 385 y(zip/doc/)0 472 y([2])g(Thomas)f(Boutell,)g(\252PNG)h(\(Portable)f (Network)f(Graphics\))h(speci\256cation\272,)h(available)e(in)h (ftp://ftp.uu.net/graphics)o(/)0 529 y(png/documents/)0 616 y([3])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 672 y(archiving/zip/doc/)0 759 y([4])13 b(Fletcher)n(,)g(J.)g(G.,)h(\252An)e(Arithmetic)g (Checksum)g(for)h(Serial)g(T)n(ransmissions,\272)e(IEEE)h(T)n (ransactions)g(on)g(Communi-)0 816 y(cations,)e(V)-6 b(ol.)15 b(COM-30,)d(No.)j(1,)d(January)e(1982,)h(pp.)k(247-252.)0 903 y([5])g(ITU-T)g(Recommendation)g(X.224,)h(Annex)e(D,)h (\252Checksum)h(Algorithms,\272)e(November)n(,)j(1993,)e(pp.)27 b(144,)15 b(145.)0 959 y(\(A)m(vailable)10 b(from)i(gopher://info.itu)o (.ch\).)h(ITU-T)e(X.244)g(is)g(also)f(the)h(same)h(as)f(ISO)h(8073.)0 1136 y Fi(4)60 b(Sour)o(ce)14 b(code)0 1270 y Fk(Source)9 b(code)g(for)f(a)h(C)h(language)d(implementation)h(of)g(a)h (\252zlib\272)g(compliant)e(library)h(is)g(available)g(at)h (ftp://ftp.uu.net/pub)o(/)0 1326 y(archiving/zip/zlib/)o(.)0 1503 y Fi(5)60 b(Security)13 b(Considerations)0 1636 y Fk(A)e(decoder)g(that)g(fails)g(to)f(check)i(the)f(ADLER32)f (checksum)h(value)g(may)g(be)h(subject)e(to)h(undetected)f(data)h (corruption.)0 1813 y Fi(6)60 b(Acknowledgements)0 1947 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 2034 y(Jean-Loup)g(Gailly)f(and)i(Mark)g(Adler)g(designed)e(the)h(zlib)h (format)g(and)f(wrote)h(the)f(related)h(software)f(described)g(in)g (this)0 2090 y(speci\256cation.)j(Glenn)d(Randers-Pehrson)g(converted)f (this)g(document)h(to)g(RFC)h(and)f(HTML)g(format.)0 2267 y Fi(7)60 b(Authors')15 b(Addr)o(esses)0 2401 y Fk(L.)c(Peter)h(Deutsch)0 2719 y(Deutsch)e(&)i(Gailly)612 b(Informational)g([Page)12 b(7])p eop %%Page: 8 8 8 7 bop 0 46 a Fk(RFC)12 b(1950)374 b(ZLIB)12 b(Compressed)f(Data)g (Format)h(Speci\256cation)374 b(May)12 b(1996)114 195 y Fd(Aladdin)29 b(Enterprises)114 252 y(203)f(Santa)g(Margarita)i(Ave.) 114 308 y(Menlo)e(Park,)h(CA)f(94025)114 421 y(Phone:)h(\(415\))f (322-0103)i(\(AM)e(only\))114 477 y(FAX:)83 b(\(415\))28 b(322-1734)114 534 y(EMail:)h()0 677 y Fk(Jean-Loup)10 b(Gailly)114 764 y Fd(EMail:)29 b()0 851 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 938 y Fd(Jean-Loup)29 b(Gailly)g()i(and)114 995 y(Mark)d(Adler)h()0 1082 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 1169 y Fd(L.)27 b(Peter)i(Deutsch)g ()i(and)114 1225 y(Glenn)d(Randers-Pehr)q(son) j()0 1402 y Fi(8)60 b(Appendix:)20 b(Rationale)0 1537 y Fe(8.1)50 b(Pr)o(eset)13 b(dictionaries)0 1655 y Fk(A)8 b(preset)g(dictionary)f(is)g(specially)g(useful)h(to)f (compress)h(short)g(input)f(sequences.)13 b(The)8 b(compressor)g(can)h (take)f(advantage)0 1711 y(of)h(the)g(dictionary)f(context)g(to)h (encode)h(the)f(input)f(in)g(a)i(more)g(compact)f(manner)n(.)15 b(The)9 b(decompressor)g(can)h(be)f(initialized)0 1768 y(with)g(the)g(appropriate)g(context)g(by)h(virtually)e(decompressing)g (a)i(compressed)g(version)f(of)h(the)f(dictionary)f(without)g(pro-)0 1824 y(ducing)h(any)i(output.)i(However)d(for)h(certain)f(compression)g (algorithms)f(such)h(as)g(the)h(de\257ate)g(algorithm)e(this)g (operation)0 1881 y(can)i(be)h(achieved)f(without)e(actually)h (performing)h(any)g(decompression.)0 1968 y(The)i(compressor)g(and)g (the)g(decompressor)f(must)h(use)g(exactly)g(the)f(same)i(dictionary)m (.)20 b(The)13 b(dictionary)e(may)j(be)f(\256xed)0 2024 y(or)h(may)g(be)g(chosen)f(among)g(a)h(certain)g(number)f(of)h (prede\256ned)g(dictionaries,)f(according)g(to)g(the)g(kind)g(of)h (input)e(data.)0 2081 y(The)f(decompressor)f(can)i(determine)f(which)f (dictionary)f(has)i(been)g(chosen)g(by)f(the)h(compressor)g(by)f (checking)h(the)f(dic-)0 2137 y(tionary)g(identi\256er)n(.)15 b(This)c(document)g(does)g(not)f(specify)h(the)h(contents)e(of)h (prede\256ned)h(dictionaries,)e(since)h(the)g(optimal)0 2193 y(dictionaries)g(are)i(application)e(speci\256c.)19 b(Standard)12 b(data)h(formats)f(using)f(this)h(feature)h(of)f(the)g (zlib)g(speci\256cation)g(must)0 2250 y(precisely)e(de\256ne)i(the)f (allowed)f(dictionaries.)0 2405 y Fe(8.2)50 b(The)13 b(Adler)n(-32)e(algorithm)0 2522 y Fk(The)g(Adler)o(-32)g(algorithm)g (is)g(much)h(faster)g(than)f(the)g(CRC32)h(algorithm)f(yet)g(still)f (provides)g(an)i(extremely)g(low)f(prob-)0 2579 y(ability)f(of)h (undetected)f(errors.)0 2719 y(Deutsch)g(&)i(Gailly)612 b(Informational)g([Page)12 b(8])p eop %%Page: 9 9 9 8 bop 0 46 a Fk(RFC)12 b(1950)374 b(ZLIB)12 b(Compressed)f(Data)g (Format)h(Speci\256cation)374 b(May)12 b(1996)0 195 y(The)f(modulo)f (on)h(unsigned)e(long)h(accumulators)h(can)g(be)g(delayed)g(for)g(5552) f(bytes,)h(so)g(the)g(modulo)f(operation)g(time)h(is)0 252 y(negligible.)k(If)d(the)f(bytes)g(are)h(a,)h(b,)f(c,)g(the)f (second)g(sum)h(is)f(3a)h(+)f(2b)g(+)h(c)g(+)f(3,)h(and)g(so)f(is)g (position)e(and)j(order)g(sensitive,)0 308 y(unlike)7 b(the)h(\256rst)h(sum,)g(which)f(is)g(just)f(a)i(checksum.)14 b(That)8 b(65521)f(is)h(prime)h(is)f(important)f(to)h(avoid)g(a)g (possible)f(lar)o(ge)i(class)0 364 y(of)g(two-byte)f(errors)i(that)e (leave)h(the)g(check)h(unchanged.)k(\(The)9 b(Fletcher)g(checksum)g (uses)g(255,)g(which)g(is)f(not)h(prime)g(and)0 421 y(which)h(also)h (makes)h(the)e(Fletcher)i(check)f(insensitive)e(to)i(single)f(byte)g (changes)h(0)g Fg()h Fk(255.\))0 508 y(The)e(sum)h(s1)f (is)g(initialized)f(to)h(1)g(instead)g(of)g(zero)h(to)f(make)i(the)e (length)f(of)i(the)f(sequence)g(part)h(of)f(s2,)h(so)f(that)g(the)g (length)0 564 y(does)h(not)f(have)h(to)g(be)g(checked)h(separately)m(.) i(\(Any)d(sequence)g(of)g(zeroes)h(has)f(a)g(Fletcher)h(checksum)f(of)g (zero.\))0 741 y Fi(9)60 b(Appendix:)20 b(Sample)14 b(code)0 875 y Fk(The)8 b(following)f(C)h(code)h(computes)f(the)g(Adler)o(-32)f (checksum)i(of)f(a)h(data)f(buf)o(fer)n(.)14 b(It)9 b(is)e(written)h (for)g(clarity)m(,)h(not)f(for)g(speed.)0 931 y(The)i(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 988 y(hints:)114 1068 y Fb(&)149 b(Bitwise)24 b(AND)h(operator.)114 1118 y(>>)124 b(Bitwise)24 b(right)h(shift)f(operator.)g(When)h (applied)f(to)h(an)288 1168 y(unsigned)f(quantity,)g(as)h(here,)f (right)h(shift)f(inserts)g(zero)h(bit\(s\))288 1217 y(at)g(the)f(left.) 114 1267 y(>)h(16\))f(&)h(0xffff;)163 2562 y(int)g(n;)0 2719 y Fk(Deutsch)10 b(&)i(Gailly)612 b(Informational)g([Page)12 b(9])p eop %%Page: 10 10 10 9 bop 0 46 a Fk(RFC)12 b(1950)374 b(ZLIB)12 b(Compressed)f(Data)g (Format)h(Speci\256cation)374 b(May)12 b(1996)163 195 y Fb(for)25 b(\(n)g(=)g(0;)f(n)h(