Hex Artifact Content

Not logged in

Artifact 51cae87bbab840558e6e416ddcac91f7206c9170:


0000: 2f 2a 20 63 72 63 33 32 2e 63 20 2d 2d 20 63 6f  /* crc32.c -- co
0010: 6d 70 75 74 65 20 74 68 65 20 43 52 43 2d 33 32  mpute the CRC-32
0020: 20 6f 66 20 61 20 64 61 74 61 20 73 74 72 65 61   of a data strea
0030: 6d 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28  m. * Copyright (
0040: 43 29 20 31 39 39 35 2d 31 39 39 38 20 4d 61 72  C) 1995-1998 Mar
0050: 6b 20 41 64 6c 65 72 0a 20 2a 20 46 6f 72 20 63  k Adler. * For c
0060: 6f 6e 64 69 74 69 6f 6e 73 20 6f 66 20 64 69 73  onditions of dis
0070: 74 72 69 62 75 74 69 6f 6e 20 61 6e 64 20 75 73  tribution and us
0080: 65 2c 20 73 65 65 20 63 6f 70 79 72 69 67 68 74  e, see copyright
0090: 20 6e 6f 74 69 63 65 20 69 6e 20 7a 6c 69 62 2e   notice in zlib.
00a0: 68 20 0a 20 2a 2f 0a 0a 2f 2a 20 40 28 23 29 20  h . */../* @(#) 
00b0: 24 49 64 24 20 2a 2f 0a 0a 23 69 6e 63 6c 75 64  $Id$ */..#includ
00c0: 65 20 22 7a 6c 69 62 2e 68 22 0a 0a 23 64 65 66  e "zlib.h"..#def
00d0: 69 6e 65 20 6c 6f 63 61 6c 20 73 74 61 74 69 63  ine local static
00e0: 0a 0a 23 69 66 64 65 66 20 44 59 4e 41 4d 49 43  ..#ifdef DYNAMIC
00f0: 5f 43 52 43 5f 54 41 42 4c 45 0a 0a 6c 6f 63 61  _CRC_TABLE..loca
0100: 6c 20 69 6e 74 20 63 72 63 5f 74 61 62 6c 65 5f  l int crc_table_
0110: 65 6d 70 74 79 20 3d 20 31 3b 0a 6c 6f 63 61 6c  empty = 1;.local
0120: 20 75 4c 6f 6e 67 66 20 63 72 63 5f 74 61 62 6c   uLongf crc_tabl
0130: 65 5b 32 35 36 5d 3b 0a 6c 6f 63 61 6c 20 76 6f  e[256];.local vo
0140: 69 64 20 6d 61 6b 65 5f 63 72 63 5f 74 61 62 6c  id make_crc_tabl
0150: 65 20 4f 46 28 28 76 6f 69 64 29 29 3b 0a 0a 2f  e OF((void));../
0160: 2a 0a 20 20 47 65 6e 65 72 61 74 65 20 61 20 74  *.  Generate a t
0170: 61 62 6c 65 20 66 6f 72 20 61 20 62 79 74 65 2d  able for a byte-
0180: 77 69 73 65 20 33 32 2d 62 69 74 20 43 52 43 20  wise 32-bit CRC 
0190: 63 61 6c 63 75 6c 61 74 69 6f 6e 20 6f 6e 20 74  calculation on t
01a0: 68 65 20 70 6f 6c 79 6e 6f 6d 69 61 6c 3a 0a 20  he polynomial:. 
01b0: 20 78 5e 33 32 2b 78 5e 32 36 2b 78 5e 32 33 2b   x^32+x^26+x^23+
01c0: 78 5e 32 32 2b 78 5e 31 36 2b 78 5e 31 32 2b 78  x^22+x^16+x^12+x
01d0: 5e 31 31 2b 78 5e 31 30 2b 78 5e 38 2b 78 5e 37  ^11+x^10+x^8+x^7
01e0: 2b 78 5e 35 2b 78 5e 34 2b 78 5e 32 2b 78 2b 31  +x^5+x^4+x^2+x+1
01f0: 2e 0a 0a 20 20 50 6f 6c 79 6e 6f 6d 69 61 6c 73  ...  Polynomials
0200: 20 6f 76 65 72 20 47 46 28 32 29 20 61 72 65 20   over GF(2) are 
0210: 72 65 70 72 65 73 65 6e 74 65 64 20 69 6e 20 62  represented in b
0220: 69 6e 61 72 79 2c 20 6f 6e 65 20 62 69 74 20 70  inary, one bit p
0230: 65 72 20 63 6f 65 66 66 69 63 69 65 6e 74 2c 0a  er coefficient,.
0240: 20 20 77 69 74 68 20 74 68 65 20 6c 6f 77 65 73    with the lowes
0250: 74 20 70 6f 77 65 72 73 20 69 6e 20 74 68 65 20  t powers in the 
0260: 6d 6f 73 74 20 73 69 67 6e 69 66 69 63 61 6e 74  most significant
0270: 20 62 69 74 2e 20 20 54 68 65 6e 20 61 64 64 69   bit.  Then addi
0280: 6e 67 20 70 6f 6c 79 6e 6f 6d 69 61 6c 73 0a 20  ng polynomials. 
0290: 20 69 73 20 6a 75 73 74 20 65 78 63 6c 75 73 69   is just exclusi
02a0: 76 65 2d 6f 72 2c 20 61 6e 64 20 6d 75 6c 74 69  ve-or, and multi
02b0: 70 6c 79 69 6e 67 20 61 20 70 6f 6c 79 6e 6f 6d  plying a polynom
02c0: 69 61 6c 20 62 79 20 78 20 69 73 20 61 20 72 69  ial by x is a ri
02d0: 67 68 74 20 73 68 69 66 74 20 62 79 0a 20 20 6f  ght shift by.  o
02e0: 6e 65 2e 20 20 49 66 20 77 65 20 63 61 6c 6c 20  ne.  If we call 
02f0: 74 68 65 20 61 62 6f 76 65 20 70 6f 6c 79 6e 6f  the above polyno
0300: 6d 69 61 6c 20 70 2c 20 61 6e 64 20 72 65 70 72  mial p, and repr
0310: 65 73 65 6e 74 20 61 20 62 79 74 65 20 61 73 20  esent a byte as 
0320: 74 68 65 0a 20 20 70 6f 6c 79 6e 6f 6d 69 61 6c  the.  polynomial
0330: 20 71 2c 20 61 6c 73 6f 20 77 69 74 68 20 74 68   q, also with th
0340: 65 20 6c 6f 77 65 73 74 20 70 6f 77 65 72 20 69  e lowest power i
0350: 6e 20 74 68 65 20 6d 6f 73 74 20 73 69 67 6e 69  n the most signi
0360: 66 69 63 61 6e 74 20 62 69 74 20 28 73 6f 20 74  ficant bit (so t
0370: 68 65 0a 20 20 62 79 74 65 20 30 78 62 31 20 69  he.  byte 0xb1 i
0380: 73 20 74 68 65 20 70 6f 6c 79 6e 6f 6d 69 61 6c  s the polynomial
0390: 20 78 5e 37 2b 78 5e 33 2b 78 2b 31 29 2c 20 74   x^7+x^3+x+1), t
03a0: 68 65 6e 20 74 68 65 20 43 52 43 20 69 73 20 28  hen the CRC is (
03b0: 71 2a 78 5e 33 32 29 20 6d 6f 64 20 70 2c 0a 20  q*x^32) mod p,. 
03c0: 20 77 68 65 72 65 20 61 20 6d 6f 64 20 62 20 6d   where a mod b m
03d0: 65 61 6e 73 20 74 68 65 20 72 65 6d 61 69 6e 64  eans the remaind
03e0: 65 72 20 61 66 74 65 72 20 64 69 76 69 64 69 6e  er after dividin
03f0: 67 20 61 20 62 79 20 62 2e 0a 0a 20 20 54 68 69  g a by b...  Thi
0400: 73 20 63 61 6c 63 75 6c 61 74 69 6f 6e 20 69 73  s calculation is
0410: 20 64 6f 6e 65 20 75 73 69 6e 67 20 74 68 65 20   done using the 
0420: 73 68 69 66 74 2d 72 65 67 69 73 74 65 72 20 6d  shift-register m
0430: 65 74 68 6f 64 20 6f 66 20 6d 75 6c 74 69 70 6c  ethod of multipl
0440: 79 69 6e 67 20 61 6e 64 0a 20 20 74 61 6b 69 6e  ying and.  takin
0450: 67 20 74 68 65 20 72 65 6d 61 69 6e 64 65 72 2e  g the remainder.
0460: 20 20 54 68 65 20 72 65 67 69 73 74 65 72 20 69    The register i
0470: 73 20 69 6e 69 74 69 61 6c 69 7a 65 64 20 74 6f  s initialized to
0480: 20 7a 65 72 6f 2c 20 61 6e 64 20 66 6f 72 20 65   zero, and for e
0490: 61 63 68 0a 20 20 69 6e 63 6f 6d 69 6e 67 20 62  ach.  incoming b
04a0: 69 74 2c 20 78 5e 33 32 20 69 73 20 61 64 64 65  it, x^32 is adde
04b0: 64 20 6d 6f 64 20 70 20 74 6f 20 74 68 65 20 72  d mod p to the r
04c0: 65 67 69 73 74 65 72 20 69 66 20 74 68 65 20 62  egister if the b
04d0: 69 74 20 69 73 20 61 20 6f 6e 65 20 28 77 68 65  it is a one (whe
04e0: 72 65 0a 20 20 78 5e 33 32 20 6d 6f 64 20 70 20  re.  x^32 mod p 
04f0: 69 73 20 70 2b 78 5e 33 32 20 3d 20 78 5e 32 36  is p+x^32 = x^26
0500: 2b 2e 2e 2e 2b 31 29 2c 20 61 6e 64 20 74 68 65  +...+1), and the
0510: 20 72 65 67 69 73 74 65 72 20 69 73 20 6d 75 6c   register is mul
0520: 74 69 70 6c 69 65 64 20 6d 6f 64 20 70 20 62 79  tiplied mod p by
0530: 0a 20 20 78 20 28 77 68 69 63 68 20 69 73 20 73  .  x (which is s
0540: 68 69 66 74 69 6e 67 20 72 69 67 68 74 20 62 79  hifting right by
0550: 20 6f 6e 65 20 61 6e 64 20 61 64 64 69 6e 67 20   one and adding 
0560: 78 5e 33 32 20 6d 6f 64 20 70 20 69 66 20 74 68  x^32 mod p if th
0570: 65 20 62 69 74 20 73 68 69 66 74 65 64 0a 20 20  e bit shifted.  
0580: 6f 75 74 20 69 73 20 61 20 6f 6e 65 29 2e 20 20  out is a one).  
0590: 57 65 20 73 74 61 72 74 20 77 69 74 68 20 74 68  We start with th
05a0: 65 20 68 69 67 68 65 73 74 20 70 6f 77 65 72 20  e highest power 
05b0: 28 6c 65 61 73 74 20 73 69 67 6e 69 66 69 63 61  (least significa
05c0: 6e 74 20 62 69 74 29 20 6f 66 0a 20 20 71 20 61  nt bit) of.  q a
05d0: 6e 64 20 72 65 70 65 61 74 20 66 6f 72 20 61 6c  nd repeat for al
05e0: 6c 20 65 69 67 68 74 20 62 69 74 73 20 6f 66 20  l eight bits of 
05f0: 71 2e 0a 0a 20 20 54 68 65 20 74 61 62 6c 65 20  q...  The table 
0600: 69 73 20 73 69 6d 70 6c 79 20 74 68 65 20 43 52  is simply the CR
0610: 43 20 6f 66 20 61 6c 6c 20 70 6f 73 73 69 62 6c  C of all possibl
0620: 65 20 65 69 67 68 74 20 62 69 74 20 76 61 6c 75  e eight bit valu
0630: 65 73 2e 20 20 54 68 69 73 20 69 73 20 61 6c 6c  es.  This is all
0640: 0a 20 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 69  .  the informati
0650: 6f 6e 20 6e 65 65 64 65 64 20 74 6f 20 67 65 6e  on needed to gen
0660: 65 72 61 74 65 20 43 52 43 27 73 20 6f 6e 20 64  erate CRC's on d
0670: 61 74 61 20 61 20 62 79 74 65 20 61 74 20 61 20  ata a byte at a 
0680: 74 69 6d 65 20 66 6f 72 20 61 6c 6c 0a 20 20 63  time for all.  c
0690: 6f 6d 62 69 6e 61 74 69 6f 6e 73 20 6f 66 20 43  ombinations of C
06a0: 52 43 20 72 65 67 69 73 74 65 72 20 76 61 6c 75  RC register valu
06b0: 65 73 20 61 6e 64 20 69 6e 63 6f 6d 69 6e 67 20  es and incoming 
06c0: 62 79 74 65 73 2e 0a 2a 2f 0a 6c 6f 63 61 6c 20  bytes..*/.local 
06d0: 76 6f 69 64 20 6d 61 6b 65 5f 63 72 63 5f 74 61  void make_crc_ta
06e0: 62 6c 65 28 29 0a 7b 0a 20 20 75 4c 6f 6e 67 20  ble().{.  uLong 
06f0: 63 3b 0a 20 20 69 6e 74 20 6e 2c 20 6b 3b 0a 20  c;.  int n, k;. 
0700: 20 75 4c 6f 6e 67 20 70 6f 6c 79 3b 20 20 20 20   uLong poly;    
0710: 20 20 20 20 20 20 20 20 2f 2a 20 70 6f 6c 79 6e          /* polyn
0720: 6f 6d 69 61 6c 20 65 78 63 6c 75 73 69 76 65 2d  omial exclusive-
0730: 6f 72 20 70 61 74 74 65 72 6e 20 2a 2f 0a 20 20  or pattern */.  
0740: 2f 2a 20 74 65 72 6d 73 20 6f 66 20 70 6f 6c 79  /* terms of poly
0750: 6e 6f 6d 69 61 6c 20 64 65 66 69 6e 69 6e 67 20  nomial defining 
0760: 74 68 69 73 20 63 72 63 20 28 65 78 63 65 70 74  this crc (except
0770: 20 78 5e 33 32 29 3a 20 2a 2f 0a 20 20 73 74 61   x^32): */.  sta
0780: 74 69 63 20 63 6f 6e 73 74 20 42 79 74 65 20 70  tic const Byte p
0790: 5b 5d 20 3d 20 7b 30 2c 31 2c 32 2c 34 2c 35 2c  [] = {0,1,2,4,5,
07a0: 37 2c 38 2c 31 30 2c 31 31 2c 31 32 2c 31 36 2c  7,8,10,11,12,16,
07b0: 32 32 2c 32 33 2c 32 36 7d 3b 0a 0a 20 20 2f 2a  22,23,26};..  /*
07c0: 20 6d 61 6b 65 20 65 78 63 6c 75 73 69 76 65 2d   make exclusive-
07d0: 6f 72 20 70 61 74 74 65 72 6e 20 66 72 6f 6d 20  or pattern from 
07e0: 70 6f 6c 79 6e 6f 6d 69 61 6c 20 28 30 78 65 64  polynomial (0xed
07f0: 62 38 38 33 32 30 4c 29 20 2a 2f 0a 20 20 70 6f  b88320L) */.  po
0800: 6c 79 20 3d 20 30 4c 3b 0a 20 20 66 6f 72 20 28  ly = 0L;.  for (
0810: 6e 20 3d 20 30 3b 20 6e 20 3c 20 73 69 7a 65 6f  n = 0; n < sizeo
0820: 66 28 70 29 2f 73 69 7a 65 6f 66 28 42 79 74 65  f(p)/sizeof(Byte
0830: 29 3b 20 6e 2b 2b 29 0a 20 20 20 20 70 6f 6c 79  ); n++).    poly
0840: 20 7c 3d 20 31 4c 20 3c 3c 20 28 33 31 20 2d 20   |= 1L << (31 - 
0850: 70 5b 6e 5d 29 3b 0a 20 0a 20 20 66 6f 72 20 28  p[n]);. .  for (
0860: 6e 20 3d 20 30 3b 20 6e 20 3c 20 32 35 36 3b 20  n = 0; n < 256; 
0870: 6e 2b 2b 29 0a 20 20 7b 0a 20 20 20 20 63 20 3d  n++).  {.    c =
0880: 20 28 75 4c 6f 6e 67 29 6e 3b 0a 20 20 20 20 66   (uLong)n;.    f
0890: 6f 72 20 28 6b 20 3d 20 30 3b 20 6b 20 3c 20 38  or (k = 0; k < 8
08a0: 3b 20 6b 2b 2b 29 0a 20 20 20 20 20 20 63 20 3d  ; k++).      c =
08b0: 20 63 20 26 20 31 20 3f 20 70 6f 6c 79 20 5e 20   c & 1 ? poly ^ 
08c0: 28 63 20 3e 3e 20 31 29 20 3a 20 63 20 3e 3e 20  (c >> 1) : c >> 
08d0: 31 3b 0a 20 20 20 20 63 72 63 5f 74 61 62 6c 65  1;.    crc_table
08e0: 5b 6e 5d 20 3d 20 63 3b 0a 20 20 7d 0a 20 20 63  [n] = c;.  }.  c
08f0: 72 63 5f 74 61 62 6c 65 5f 65 6d 70 74 79 20 3d  rc_table_empty =
0900: 20 30 3b 0a 7d 0a 23 65 6c 73 65 0a 2f 2a 20 3d   0;.}.#else./* =
0910: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0920: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0930: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0940: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0950: 3d 3d 3d 3d 3d 3d 3d 0a 20 2a 20 54 61 62 6c 65  =======. * Table
0960: 20 6f 66 20 43 52 43 2d 33 32 27 73 20 6f 66 20   of CRC-32's of 
0970: 61 6c 6c 20 73 69 6e 67 6c 65 2d 62 79 74 65 20  all single-byte 
0980: 76 61 6c 75 65 73 20 28 6d 61 64 65 20 62 79 20  values (made by 
0990: 6d 61 6b 65 5f 63 72 63 5f 74 61 62 6c 65 29 0a  make_crc_table).
09a0: 20 2a 2f 0a 6c 6f 63 61 6c 20 63 6f 6e 73 74 20   */.local const 
09b0: 75 4c 6f 6e 67 66 20 63 72 63 5f 74 61 62 6c 65  uLongf crc_table
09c0: 5b 32 35 36 5d 20 3d 20 7b 0a 20 20 30 78 30 30  [256] = {.  0x00
09d0: 30 30 30 30 30 30 4c 2c 20 30 78 37 37 30 37 33  000000L, 0x77073
09e0: 30 39 36 4c 2c 20 30 78 65 65 30 65 36 31 32 63  096L, 0xee0e612c
09f0: 4c 2c 20 30 78 39 39 30 39 35 31 62 61 4c 2c 20  L, 0x990951baL, 
0a00: 30 78 30 37 36 64 63 34 31 39 4c 2c 0a 20 20 30  0x076dc419L,.  0
0a10: 78 37 30 36 61 66 34 38 66 4c 2c 20 30 78 65 39  x706af48fL, 0xe9
0a20: 36 33 61 35 33 35 4c 2c 20 30 78 39 65 36 34 39  63a535L, 0x9e649
0a30: 35 61 33 4c 2c 20 30 78 30 65 64 62 38 38 33 32  5a3L, 0x0edb8832
0a40: 4c 2c 20 30 78 37 39 64 63 62 38 61 34 4c 2c 0a  L, 0x79dcb8a4L,.
0a50: 20 20 30 78 65 30 64 35 65 39 31 65 4c 2c 20 30    0xe0d5e91eL, 0
0a60: 78 39 37 64 32 64 39 38 38 4c 2c 20 30 78 30 39  x97d2d988L, 0x09
0a70: 62 36 34 63 32 62 4c 2c 20 30 78 37 65 62 31 37  b64c2bL, 0x7eb17
0a80: 63 62 64 4c 2c 20 30 78 65 37 62 38 32 64 30 37  cbdL, 0xe7b82d07
0a90: 4c 2c 0a 20 20 30 78 39 30 62 66 31 64 39 31 4c  L,.  0x90bf1d91L
0aa0: 2c 20 30 78 31 64 62 37 31 30 36 34 4c 2c 20 30  , 0x1db71064L, 0
0ab0: 78 36 61 62 30 32 30 66 32 4c 2c 20 30 78 66 33  x6ab020f2L, 0xf3
0ac0: 62 39 37 31 34 38 4c 2c 20 30 78 38 34 62 65 34  b97148L, 0x84be4
0ad0: 31 64 65 4c 2c 0a 20 20 30 78 31 61 64 61 64 34  1deL,.  0x1adad4
0ae0: 37 64 4c 2c 20 30 78 36 64 64 64 65 34 65 62 4c  7dL, 0x6ddde4ebL
0af0: 2c 20 30 78 66 34 64 34 62 35 35 31 4c 2c 20 30  , 0xf4d4b551L, 0
0b00: 78 38 33 64 33 38 35 63 37 4c 2c 20 30 78 31 33  x83d385c7L, 0x13
0b10: 36 63 39 38 35 36 4c 2c 0a 20 20 30 78 36 34 36  6c9856L,.  0x646
0b20: 62 61 38 63 30 4c 2c 20 30 78 66 64 36 32 66 39  ba8c0L, 0xfd62f9
0b30: 37 61 4c 2c 20 30 78 38 61 36 35 63 39 65 63 4c  7aL, 0x8a65c9ecL
0b40: 2c 20 30 78 31 34 30 31 35 63 34 66 4c 2c 20 30  , 0x14015c4fL, 0
0b50: 78 36 33 30 36 36 63 64 39 4c 2c 0a 20 20 30 78  x63066cd9L,.  0x
0b60: 66 61 30 66 33 64 36 33 4c 2c 20 30 78 38 64 30  fa0f3d63L, 0x8d0
0b70: 38 30 64 66 35 4c 2c 20 30 78 33 62 36 65 32 30  80df5L, 0x3b6e20
0b80: 63 38 4c 2c 20 30 78 34 63 36 39 31 30 35 65 4c  c8L, 0x4c69105eL
0b90: 2c 20 30 78 64 35 36 30 34 31 65 34 4c 2c 0a 20  , 0xd56041e4L,. 
0ba0: 20 30 78 61 32 36 37 37 31 37 32 4c 2c 20 30 78   0xa2677172L, 0x
0bb0: 33 63 30 33 65 34 64 31 4c 2c 20 30 78 34 62 30  3c03e4d1L, 0x4b0
0bc0: 34 64 34 34 37 4c 2c 20 30 78 64 32 30 64 38 35  4d447L, 0xd20d85
0bd0: 66 64 4c 2c 20 30 78 61 35 30 61 62 35 36 62 4c  fdL, 0xa50ab56bL
0be0: 2c 0a 20 20 30 78 33 35 62 35 61 38 66 61 4c 2c  ,.  0x35b5a8faL,
0bf0: 20 30 78 34 32 62 32 39 38 36 63 4c 2c 20 30 78   0x42b2986cL, 0x
0c00: 64 62 62 62 63 39 64 36 4c 2c 20 30 78 61 63 62  dbbbc9d6L, 0xacb
0c10: 63 66 39 34 30 4c 2c 20 30 78 33 32 64 38 36 63  cf940L, 0x32d86c
0c20: 65 33 4c 2c 0a 20 20 30 78 34 35 64 66 35 63 37  e3L,.  0x45df5c7
0c30: 35 4c 2c 20 30 78 64 63 64 36 30 64 63 66 4c 2c  5L, 0xdcd60dcfL,
0c40: 20 30 78 61 62 64 31 33 64 35 39 4c 2c 20 30 78   0xabd13d59L, 0x
0c50: 32 36 64 39 33 30 61 63 4c 2c 20 30 78 35 31 64  26d930acL, 0x51d
0c60: 65 30 30 33 61 4c 2c 0a 20 20 30 78 63 38 64 37  e003aL,.  0xc8d7
0c70: 35 31 38 30 4c 2c 20 30 78 62 66 64 30 36 31 31  5180L, 0xbfd0611
0c80: 36 4c 2c 20 30 78 32 31 62 34 66 34 62 35 4c 2c  6L, 0x21b4f4b5L,
0c90: 20 30 78 35 36 62 33 63 34 32 33 4c 2c 20 30 78   0x56b3c423L, 0x
0ca0: 63 66 62 61 39 35 39 39 4c 2c 0a 20 20 30 78 62  cfba9599L,.  0xb
0cb0: 38 62 64 61 35 30 66 4c 2c 20 30 78 32 38 30 32  8bda50fL, 0x2802
0cc0: 62 38 39 65 4c 2c 20 30 78 35 66 30 35 38 38 30  b89eL, 0x5f05880
0cd0: 38 4c 2c 20 30 78 63 36 30 63 64 39 62 32 4c 2c  8L, 0xc60cd9b2L,
0ce0: 20 30 78 62 31 30 62 65 39 32 34 4c 2c 0a 20 20   0xb10be924L,.  
0cf0: 30 78 32 66 36 66 37 63 38 37 4c 2c 20 30 78 35  0x2f6f7c87L, 0x5
0d00: 38 36 38 34 63 31 31 4c 2c 20 30 78 63 31 36 31  8684c11L, 0xc161
0d10: 31 64 61 62 4c 2c 20 30 78 62 36 36 36 32 64 33  1dabL, 0xb6662d3
0d20: 64 4c 2c 20 30 78 37 36 64 63 34 31 39 30 4c 2c  dL, 0x76dc4190L,
0d30: 0a 20 20 30 78 30 31 64 62 37 31 30 36 4c 2c 20  .  0x01db7106L, 
0d40: 30 78 39 38 64 32 32 30 62 63 4c 2c 20 30 78 65  0x98d220bcL, 0xe
0d50: 66 64 35 31 30 32 61 4c 2c 20 30 78 37 31 62 31  fd5102aL, 0x71b1
0d60: 38 35 38 39 4c 2c 20 30 78 30 36 62 36 62 35 31  8589L, 0x06b6b51
0d70: 66 4c 2c 0a 20 20 30 78 39 66 62 66 65 34 61 35  fL,.  0x9fbfe4a5
0d80: 4c 2c 20 30 78 65 38 62 38 64 34 33 33 4c 2c 20  L, 0xe8b8d433L, 
0d90: 30 78 37 38 30 37 63 39 61 32 4c 2c 20 30 78 30  0x7807c9a2L, 0x0
0da0: 66 30 30 66 39 33 34 4c 2c 20 30 78 39 36 30 39  f00f934L, 0x9609
0db0: 61 38 38 65 4c 2c 0a 20 20 30 78 65 31 30 65 39  a88eL,.  0xe10e9
0dc0: 38 31 38 4c 2c 20 30 78 37 66 36 61 30 64 62 62  818L, 0x7f6a0dbb
0dd0: 4c 2c 20 30 78 30 38 36 64 33 64 32 64 4c 2c 20  L, 0x086d3d2dL, 
0de0: 30 78 39 31 36 34 36 63 39 37 4c 2c 20 30 78 65  0x91646c97L, 0xe
0df0: 36 36 33 35 63 30 31 4c 2c 0a 20 20 30 78 36 62  6635c01L,.  0x6b
0e00: 36 62 35 31 66 34 4c 2c 20 30 78 31 63 36 63 36  6b51f4L, 0x1c6c6
0e10: 31 36 32 4c 2c 20 30 78 38 35 36 35 33 30 64 38  162L, 0x856530d8
0e20: 4c 2c 20 30 78 66 32 36 32 30 30 34 65 4c 2c 20  L, 0xf262004eL, 
0e30: 30 78 36 63 30 36 39 35 65 64 4c 2c 0a 20 20 30  0x6c0695edL,.  0
0e40: 78 31 62 30 31 61 35 37 62 4c 2c 20 30 78 38 32  x1b01a57bL, 0x82
0e50: 30 38 66 34 63 31 4c 2c 20 30 78 66 35 30 66 63  08f4c1L, 0xf50fc
0e60: 34 35 37 4c 2c 20 30 78 36 35 62 30 64 39 63 36  457L, 0x65b0d9c6
0e70: 4c 2c 20 30 78 31 32 62 37 65 39 35 30 4c 2c 0a  L, 0x12b7e950L,.
0e80: 20 20 30 78 38 62 62 65 62 38 65 61 4c 2c 20 30    0x8bbeb8eaL, 0
0e90: 78 66 63 62 39 38 38 37 63 4c 2c 20 30 78 36 32  xfcb9887cL, 0x62
0ea0: 64 64 31 64 64 66 4c 2c 20 30 78 31 35 64 61 32  dd1ddfL, 0x15da2
0eb0: 64 34 39 4c 2c 20 30 78 38 63 64 33 37 63 66 33  d49L, 0x8cd37cf3
0ec0: 4c 2c 0a 20 20 30 78 66 62 64 34 34 63 36 35 4c  L,.  0xfbd44c65L
0ed0: 2c 20 30 78 34 64 62 32 36 31 35 38 4c 2c 20 30  , 0x4db26158L, 0
0ee0: 78 33 61 62 35 35 31 63 65 4c 2c 20 30 78 61 33  x3ab551ceL, 0xa3
0ef0: 62 63 30 30 37 34 4c 2c 20 30 78 64 34 62 62 33  bc0074L, 0xd4bb3
0f00: 30 65 32 4c 2c 0a 20 20 30 78 34 61 64 66 61 35  0e2L,.  0x4adfa5
0f10: 34 31 4c 2c 20 30 78 33 64 64 38 39 35 64 37 4c  41L, 0x3dd895d7L
0f20: 2c 20 30 78 61 34 64 31 63 34 36 64 4c 2c 20 30  , 0xa4d1c46dL, 0
0f30: 78 64 33 64 36 66 34 66 62 4c 2c 20 30 78 34 33  xd3d6f4fbL, 0x43
0f40: 36 39 65 39 36 61 4c 2c 0a 20 20 30 78 33 34 36  69e96aL,.  0x346
0f50: 65 64 39 66 63 4c 2c 20 30 78 61 64 36 37 38 38  ed9fcL, 0xad6788
0f60: 34 36 4c 2c 20 30 78 64 61 36 30 62 38 64 30 4c  46L, 0xda60b8d0L
0f70: 2c 20 30 78 34 34 30 34 32 64 37 33 4c 2c 20 30  , 0x44042d73L, 0
0f80: 78 33 33 30 33 31 64 65 35 4c 2c 0a 20 20 30 78  x33031de5L,.  0x
0f90: 61 61 30 61 34 63 35 66 4c 2c 20 30 78 64 64 30  aa0a4c5fL, 0xdd0
0fa0: 64 37 63 63 39 4c 2c 20 30 78 35 30 30 35 37 31  d7cc9L, 0x500571
0fb0: 33 63 4c 2c 20 30 78 32 37 30 32 34 31 61 61 4c  3cL, 0x270241aaL
0fc0: 2c 20 30 78 62 65 30 62 31 30 31 30 4c 2c 0a 20  , 0xbe0b1010L,. 
0fd0: 20 30 78 63 39 30 63 32 30 38 36 4c 2c 20 30 78   0xc90c2086L, 0x
0fe0: 35 37 36 38 62 35 32 35 4c 2c 20 30 78 32 30 36  5768b525L, 0x206
0ff0: 66 38 35 62 33 4c 2c 20 30 78 62 39 36 36 64 34  f85b3L, 0xb966d4
1000: 30 39 4c 2c 20 30 78 63 65 36 31 65 34 39 66 4c  09L, 0xce61e49fL
1010: 2c 0a 20 20 30 78 35 65 64 65 66 39 30 65 4c 2c  ,.  0x5edef90eL,
1020: 20 30 78 32 39 64 39 63 39 39 38 4c 2c 20 30 78   0x29d9c998L, 0x
1030: 62 30 64 30 39 38 32 32 4c 2c 20 30 78 63 37 64  b0d09822L, 0xc7d
1040: 37 61 38 62 34 4c 2c 20 30 78 35 39 62 33 33 64  7a8b4L, 0x59b33d
1050: 31 37 4c 2c 0a 20 20 30 78 32 65 62 34 30 64 38  17L,.  0x2eb40d8
1060: 31 4c 2c 20 30 78 62 37 62 64 35 63 33 62 4c 2c  1L, 0xb7bd5c3bL,
1070: 20 30 78 63 30 62 61 36 63 61 64 4c 2c 20 30 78   0xc0ba6cadL, 0x
1080: 65 64 62 38 38 33 32 30 4c 2c 20 30 78 39 61 62  edb88320L, 0x9ab
1090: 66 62 33 62 36 4c 2c 0a 20 20 30 78 30 33 62 36  fb3b6L,.  0x03b6
10a0: 65 32 30 63 4c 2c 20 30 78 37 34 62 31 64 32 39  e20cL, 0x74b1d29
10b0: 61 4c 2c 20 30 78 65 61 64 35 34 37 33 39 4c 2c  aL, 0xead54739L,
10c0: 20 30 78 39 64 64 32 37 37 61 66 4c 2c 20 30 78   0x9dd277afL, 0x
10d0: 30 34 64 62 32 36 31 35 4c 2c 0a 20 20 30 78 37  04db2615L,.  0x7
10e0: 33 64 63 31 36 38 33 4c 2c 20 30 78 65 33 36 33  3dc1683L, 0xe363
10f0: 30 62 31 32 4c 2c 20 30 78 39 34 36 34 33 62 38  0b12L, 0x94643b8
1100: 34 4c 2c 20 30 78 30 64 36 64 36 61 33 65 4c 2c  4L, 0x0d6d6a3eL,
1110: 20 30 78 37 61 36 61 35 61 61 38 4c 2c 0a 20 20   0x7a6a5aa8L,.  
1120: 30 78 65 34 30 65 63 66 30 62 4c 2c 20 30 78 39  0xe40ecf0bL, 0x9
1130: 33 30 39 66 66 39 64 4c 2c 20 30 78 30 61 30 30  309ff9dL, 0x0a00
1140: 61 65 32 37 4c 2c 20 30 78 37 64 30 37 39 65 62  ae27L, 0x7d079eb
1150: 31 4c 2c 20 30 78 66 30 30 66 39 33 34 34 4c 2c  1L, 0xf00f9344L,
1160: 0a 20 20 30 78 38 37 30 38 61 33 64 32 4c 2c 20  .  0x8708a3d2L, 
1170: 30 78 31 65 30 31 66 32 36 38 4c 2c 20 30 78 36  0x1e01f268L, 0x6
1180: 39 30 36 63 32 66 65 4c 2c 20 30 78 66 37 36 32  906c2feL, 0xf762
1190: 35 37 35 64 4c 2c 20 30 78 38 30 36 35 36 37 63  575dL, 0x806567c
11a0: 62 4c 2c 0a 20 20 30 78 31 39 36 63 33 36 37 31  bL,.  0x196c3671
11b0: 4c 2c 20 30 78 36 65 36 62 30 36 65 37 4c 2c 20  L, 0x6e6b06e7L, 
11c0: 30 78 66 65 64 34 31 62 37 36 4c 2c 20 30 78 38  0xfed41b76L, 0x8
11d0: 39 64 33 32 62 65 30 4c 2c 20 30 78 31 30 64 61  9d32be0L, 0x10da
11e0: 37 61 35 61 4c 2c 0a 20 20 30 78 36 37 64 64 34  7a5aL,.  0x67dd4
11f0: 61 63 63 4c 2c 20 30 78 66 39 62 39 64 66 36 66  accL, 0xf9b9df6f
1200: 4c 2c 20 30 78 38 65 62 65 65 66 66 39 4c 2c 20  L, 0x8ebeeff9L, 
1210: 30 78 31 37 62 37 62 65 34 33 4c 2c 20 30 78 36  0x17b7be43L, 0x6
1220: 30 62 30 38 65 64 35 4c 2c 0a 20 20 30 78 64 36  0b08ed5L,.  0xd6
1230: 64 36 61 33 65 38 4c 2c 20 30 78 61 31 64 31 39  d6a3e8L, 0xa1d19
1240: 33 37 65 4c 2c 20 30 78 33 38 64 38 63 32 63 34  37eL, 0x38d8c2c4
1250: 4c 2c 20 30 78 34 66 64 66 66 32 35 32 4c 2c 20  L, 0x4fdff252L, 
1260: 30 78 64 31 62 62 36 37 66 31 4c 2c 0a 20 20 30  0xd1bb67f1L,.  0
1270: 78 61 36 62 63 35 37 36 37 4c 2c 20 30 78 33 66  xa6bc5767L, 0x3f
1280: 62 35 30 36 64 64 4c 2c 20 30 78 34 38 62 32 33  b506ddL, 0x48b23
1290: 36 34 62 4c 2c 20 30 78 64 38 30 64 32 62 64 61  64bL, 0xd80d2bda
12a0: 4c 2c 20 30 78 61 66 30 61 31 62 34 63 4c 2c 0a  L, 0xaf0a1b4cL,.
12b0: 20 20 30 78 33 36 30 33 34 61 66 36 4c 2c 20 30    0x36034af6L, 0
12c0: 78 34 31 30 34 37 61 36 30 4c 2c 20 30 78 64 66  x41047a60L, 0xdf
12d0: 36 30 65 66 63 33 4c 2c 20 30 78 61 38 36 37 64  60efc3L, 0xa867d
12e0: 66 35 35 4c 2c 20 30 78 33 31 36 65 38 65 65 66  f55L, 0x316e8eef
12f0: 4c 2c 0a 20 20 30 78 34 36 36 39 62 65 37 39 4c  L,.  0x4669be79L
1300: 2c 20 30 78 63 62 36 31 62 33 38 63 4c 2c 20 30  , 0xcb61b38cL, 0
1310: 78 62 63 36 36 38 33 31 61 4c 2c 20 30 78 32 35  xbc66831aL, 0x25
1320: 36 66 64 32 61 30 4c 2c 20 30 78 35 32 36 38 65  6fd2a0L, 0x5268e
1330: 32 33 36 4c 2c 0a 20 20 30 78 63 63 30 63 37 37  236L,.  0xcc0c77
1340: 39 35 4c 2c 20 30 78 62 62 30 62 34 37 30 33 4c  95L, 0xbb0b4703L
1350: 2c 20 30 78 32 32 30 32 31 36 62 39 4c 2c 20 30  , 0x220216b9L, 0
1360: 78 35 35 30 35 32 36 32 66 4c 2c 20 30 78 63 35  x5505262fL, 0xc5
1370: 62 61 33 62 62 65 4c 2c 0a 20 20 30 78 62 32 62  ba3bbeL,.  0xb2b
1380: 64 30 62 32 38 4c 2c 20 30 78 32 62 62 34 35 61  d0b28L, 0x2bb45a
1390: 39 32 4c 2c 20 30 78 35 63 62 33 36 61 30 34 4c  92L, 0x5cb36a04L
13a0: 2c 20 30 78 63 32 64 37 66 66 61 37 4c 2c 20 30  , 0xc2d7ffa7L, 0
13b0: 78 62 35 64 30 63 66 33 31 4c 2c 0a 20 20 30 78  xb5d0cf31L,.  0x
13c0: 32 63 64 39 39 65 38 62 4c 2c 20 30 78 35 62 64  2cd99e8bL, 0x5bd
13d0: 65 61 65 31 64 4c 2c 20 30 78 39 62 36 34 63 32  eae1dL, 0x9b64c2
13e0: 62 30 4c 2c 20 30 78 65 63 36 33 66 32 32 36 4c  b0L, 0xec63f226L
13f0: 2c 20 30 78 37 35 36 61 61 33 39 63 4c 2c 0a 20  , 0x756aa39cL,. 
1400: 20 30 78 30 32 36 64 39 33 30 61 4c 2c 20 30 78   0x026d930aL, 0x
1410: 39 63 30 39 30 36 61 39 4c 2c 20 30 78 65 62 30  9c0906a9L, 0xeb0
1420: 65 33 36 33 66 4c 2c 20 30 78 37 32 30 37 36 37  e363fL, 0x720767
1430: 38 35 4c 2c 20 30 78 30 35 30 30 35 37 31 33 4c  85L, 0x05005713L
1440: 2c 0a 20 20 30 78 39 35 62 66 34 61 38 32 4c 2c  ,.  0x95bf4a82L,
1450: 20 30 78 65 32 62 38 37 61 31 34 4c 2c 20 30 78   0xe2b87a14L, 0x
1460: 37 62 62 31 32 62 61 65 4c 2c 20 30 78 30 63 62  7bb12baeL, 0x0cb
1470: 36 31 62 33 38 4c 2c 20 30 78 39 32 64 32 38 65  61b38L, 0x92d28e
1480: 39 62 4c 2c 0a 20 20 30 78 65 35 64 35 62 65 30  9bL,.  0xe5d5be0
1490: 64 4c 2c 20 30 78 37 63 64 63 65 66 62 37 4c 2c  dL, 0x7cdcefb7L,
14a0: 20 30 78 30 62 64 62 64 66 32 31 4c 2c 20 30 78   0x0bdbdf21L, 0x
14b0: 38 36 64 33 64 32 64 34 4c 2c 20 30 78 66 31 64  86d3d2d4L, 0xf1d
14c0: 34 65 32 34 32 4c 2c 0a 20 20 30 78 36 38 64 64  4e242L,.  0x68dd
14d0: 62 33 66 38 4c 2c 20 30 78 31 66 64 61 38 33 36  b3f8L, 0x1fda836
14e0: 65 4c 2c 20 30 78 38 31 62 65 31 36 63 64 4c 2c  eL, 0x81be16cdL,
14f0: 20 30 78 66 36 62 39 32 36 35 62 4c 2c 20 30 78   0xf6b9265bL, 0x
1500: 36 66 62 30 37 37 65 31 4c 2c 0a 20 20 30 78 31  6fb077e1L,.  0x1
1510: 38 62 37 34 37 37 37 4c 2c 20 30 78 38 38 30 38  8b74777L, 0x8808
1520: 35 61 65 36 4c 2c 20 30 78 66 66 30 66 36 61 37  5ae6L, 0xff0f6a7
1530: 30 4c 2c 20 30 78 36 36 30 36 33 62 63 61 4c 2c  0L, 0x66063bcaL,
1540: 20 30 78 31 31 30 31 30 62 35 63 4c 2c 0a 20 20   0x11010b5cL,.  
1550: 30 78 38 66 36 35 39 65 66 66 4c 2c 20 30 78 66  0x8f659effL, 0xf
1560: 38 36 32 61 65 36 39 4c 2c 20 30 78 36 31 36 62  862ae69L, 0x616b
1570: 66 66 64 33 4c 2c 20 30 78 31 36 36 63 63 66 34  ffd3L, 0x166ccf4
1580: 35 4c 2c 20 30 78 61 30 30 61 65 32 37 38 4c 2c  5L, 0xa00ae278L,
1590: 0a 20 20 30 78 64 37 30 64 64 32 65 65 4c 2c 20  .  0xd70dd2eeL, 
15a0: 30 78 34 65 30 34 38 33 35 34 4c 2c 20 30 78 33  0x4e048354L, 0x3
15b0: 39 30 33 62 33 63 32 4c 2c 20 30 78 61 37 36 37  903b3c2L, 0xa767
15c0: 32 36 36 31 4c 2c 20 30 78 64 30 36 30 31 36 66  2661L, 0xd06016f
15d0: 37 4c 2c 0a 20 20 30 78 34 39 36 39 34 37 34 64  7L,.  0x4969474d
15e0: 4c 2c 20 30 78 33 65 36 65 37 37 64 62 4c 2c 20  L, 0x3e6e77dbL, 
15f0: 30 78 61 65 64 31 36 61 34 61 4c 2c 20 30 78 64  0xaed16a4aL, 0xd
1600: 39 64 36 35 61 64 63 4c 2c 20 30 78 34 30 64 66  9d65adcL, 0x40df
1610: 30 62 36 36 4c 2c 0a 20 20 30 78 33 37 64 38 33  0b66L,.  0x37d83
1620: 62 66 30 4c 2c 20 30 78 61 39 62 63 61 65 35 33  bf0L, 0xa9bcae53
1630: 4c 2c 20 30 78 64 65 62 62 39 65 63 35 4c 2c 20  L, 0xdebb9ec5L, 
1640: 30 78 34 37 62 32 63 66 37 66 4c 2c 20 30 78 33  0x47b2cf7fL, 0x3
1650: 30 62 35 66 66 65 39 4c 2c 0a 20 20 30 78 62 64  0b5ffe9L,.  0xbd
1660: 62 64 66 32 31 63 4c 2c 20 30 78 63 61 62 61 63  bdf21cL, 0xcabac
1670: 32 38 61 4c 2c 20 30 78 35 33 62 33 39 33 33 30  28aL, 0x53b39330
1680: 4c 2c 20 30 78 32 34 62 34 61 33 61 36 4c 2c 20  L, 0x24b4a3a6L, 
1690: 30 78 62 61 64 30 33 36 30 35 4c 2c 0a 20 20 30  0xbad03605L,.  0
16a0: 78 63 64 64 37 30 36 39 33 4c 2c 20 30 78 35 34  xcdd70693L, 0x54
16b0: 64 65 35 37 32 39 4c 2c 20 30 78 32 33 64 39 36  de5729L, 0x23d96
16c0: 37 62 66 4c 2c 20 30 78 62 33 36 36 37 61 32 65  7bfL, 0xb3667a2e
16d0: 4c 2c 20 30 78 63 34 36 31 34 61 62 38 4c 2c 0a  L, 0xc4614ab8L,.
16e0: 20 20 30 78 35 64 36 38 31 62 30 32 4c 2c 20 30    0x5d681b02L, 0
16f0: 78 32 61 36 66 32 62 39 34 4c 2c 20 30 78 62 34  x2a6f2b94L, 0xb4
1700: 30 62 62 65 33 37 4c 2c 20 30 78 63 33 30 63 38  0bbe37L, 0xc30c8
1710: 65 61 31 4c 2c 20 30 78 35 61 30 35 64 66 31 62  ea1L, 0x5a05df1b
1720: 4c 2c 0a 20 20 30 78 32 64 30 32 65 66 38 64 4c  L,.  0x2d02ef8dL
1730: 0a 7d 3b 0a 23 65 6e 64 69 66 0a 0a 2f 2a 20 3d  .};.#endif../* =
1740: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1750: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1760: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1770: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1780: 3d 3d 3d 3d 3d 3d 3d 3d 0a 20 2a 20 54 68 69 73  ========. * This
1790: 20 66 75 6e 63 74 69 6f 6e 20 63 61 6e 20 62 65   function can be
17a0: 20 75 73 65 64 20 62 79 20 61 73 6d 20 76 65 72   used by asm ver
17b0: 73 69 6f 6e 73 20 6f 66 20 63 72 63 33 32 28 29  sions of crc32()
17c0: 0a 20 2a 2f 0a 63 6f 6e 73 74 20 75 4c 6f 6e 67  . */.const uLong
17d0: 66 20 2a 20 5a 45 58 50 4f 52 54 20 67 65 74 5f  f * ZEXPORT get_
17e0: 63 72 63 5f 74 61 62 6c 65 28 29 0a 7b 0a 23 69  crc_table().{.#i
17f0: 66 64 65 66 20 44 59 4e 41 4d 49 43 5f 43 52 43  fdef DYNAMIC_CRC
1800: 5f 54 41 42 4c 45 0a 20 20 69 66 20 28 63 72 63  _TABLE.  if (crc
1810: 5f 74 61 62 6c 65 5f 65 6d 70 74 79 29 20 6d 61  _table_empty) ma
1820: 6b 65 5f 63 72 63 5f 74 61 62 6c 65 28 29 3b 0a  ke_crc_table();.
1830: 23 65 6e 64 69 66 0a 20 20 72 65 74 75 72 6e 20  #endif.  return 
1840: 28 63 6f 6e 73 74 20 75 4c 6f 6e 67 66 20 2a 29  (const uLongf *)
1850: 63 72 63 5f 74 61 62 6c 65 3b 0a 7d 0a 0a 2f 2a  crc_table;.}../*
1860: 20 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d   ===============
1870: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1880: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1890: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
18a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 20 2a 2f 0a 23 64  ========== */.#d
18b0: 65 66 69 6e 65 20 44 4f 31 28 62 75 66 29 20 63  efine DO1(buf) c
18c0: 72 63 20 3d 20 63 72 63 5f 74 61 62 6c 65 5b 28  rc = crc_table[(
18d0: 28 69 6e 74 29 63 72 63 20 5e 20 28 2a 62 75 66  (int)crc ^ (*buf
18e0: 2b 2b 29 29 20 26 20 30 78 66 66 5d 20 5e 20 28  ++)) & 0xff] ^ (
18f0: 63 72 63 20 3e 3e 20 38 29 3b 0a 23 64 65 66 69  crc >> 8);.#defi
1900: 6e 65 20 44 4f 32 28 62 75 66 29 20 20 44 4f 31  ne DO2(buf)  DO1
1910: 28 62 75 66 29 3b 20 44 4f 31 28 62 75 66 29 3b  (buf); DO1(buf);
1920: 0a 23 64 65 66 69 6e 65 20 44 4f 34 28 62 75 66  .#define DO4(buf
1930: 29 20 20 44 4f 32 28 62 75 66 29 3b 20 44 4f 32  )  DO2(buf); DO2
1940: 28 62 75 66 29 3b 0a 23 64 65 66 69 6e 65 20 44  (buf);.#define D
1950: 4f 38 28 62 75 66 29 20 20 44 4f 34 28 62 75 66  O8(buf)  DO4(buf
1960: 29 3b 20 44 4f 34 28 62 75 66 29 3b 0a 0a 2f 2a  ); DO4(buf);../*
1970: 20 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d   ===============
1980: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1990: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
19a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
19b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 20 2a 2f 0a 75 4c  ========== */.uL
19c0: 6f 6e 67 20 5a 45 58 50 4f 52 54 20 63 72 63 33  ong ZEXPORT crc3
19d0: 32 28 63 72 63 2c 20 62 75 66 2c 20 6c 65 6e 29  2(crc, buf, len)
19e0: 0a 20 20 20 20 75 4c 6f 6e 67 20 63 72 63 3b 0a  .    uLong crc;.
19f0: 20 20 20 20 63 6f 6e 73 74 20 42 79 74 65 66 20      const Bytef 
1a00: 2a 62 75 66 3b 0a 20 20 20 20 75 49 6e 74 20 6c  *buf;.    uInt l
1a10: 65 6e 3b 0a 7b 0a 20 20 20 20 69 66 20 28 62 75  en;.{.    if (bu
1a20: 66 20 3d 3d 20 5a 5f 4e 55 4c 4c 29 20 72 65 74  f == Z_NULL) ret
1a30: 75 72 6e 20 30 4c 3b 0a 23 69 66 64 65 66 20 44  urn 0L;.#ifdef D
1a40: 59 4e 41 4d 49 43 5f 43 52 43 5f 54 41 42 4c 45  YNAMIC_CRC_TABLE
1a50: 0a 20 20 20 20 69 66 20 28 63 72 63 5f 74 61 62  .    if (crc_tab
1a60: 6c 65 5f 65 6d 70 74 79 29 0a 20 20 20 20 20 20  le_empty).      
1a70: 6d 61 6b 65 5f 63 72 63 5f 74 61 62 6c 65 28 29  make_crc_table()
1a80: 3b 0a 23 65 6e 64 69 66 0a 20 20 20 20 63 72 63  ;.#endif.    crc
1a90: 20 3d 20 63 72 63 20 5e 20 30 78 66 66 66 66 66   = crc ^ 0xfffff
1aa0: 66 66 66 4c 3b 0a 20 20 20 20 77 68 69 6c 65 20  fffL;.    while 
1ab0: 28 6c 65 6e 20 3e 3d 20 38 29 0a 20 20 20 20 7b  (len >= 8).    {
1ac0: 0a 20 20 20 20 20 20 44 4f 38 28 62 75 66 29 3b  .      DO8(buf);
1ad0: 0a 20 20 20 20 20 20 6c 65 6e 20 2d 3d 20 38 3b  .      len -= 8;
1ae0: 0a 20 20 20 20 7d 0a 20 20 20 20 69 66 20 28 6c  .    }.    if (l
1af0: 65 6e 29 20 64 6f 20 7b 0a 20 20 20 20 20 20 44  en) do {.      D
1b00: 4f 31 28 62 75 66 29 3b 0a 20 20 20 20 7d 20 77  O1(buf);.    } w
1b10: 68 69 6c 65 20 28 2d 2d 6c 65 6e 29 3b 0a 20 20  hile (--len);.  
1b20: 20 20 72 65 74 75 72 6e 20 63 72 63 20 5e 20 30    return crc ^ 0
1b30: 78 66 66 66 66 66 66 66 66 4c 3b 0a 7d 0a        xffffffffL;.}.