
      unsigned long update_adler32(unsigned long adler,
         unsigned char *buf, int len)
      {
        unsigned long s1 = adler &amp; 0xffff;
        unsigned long s2 = (adler &gt;&gt; 16) &amp; 0xffff;
        int n;

        for (n = 0; n &lt; len; n++) {
          s1 = (s1 + buf[n]) % BASE;
          s2 = (s2 + s1)     % BASE;
        }
        return (s2 &lt;&lt; 16) + s1;
      }

      /* Return the adler32 of the bytes buf[0..len-1] */




<span class="grey">Deutsch &amp; Gailly             I