亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? crc32.c

?? ZIP壓縮算法源代碼,可以直接加入C++Project中編譯調(diào)用
?? C
字號:
/* crc32.c -- compute the CRC-32 of a data stream
 * Copyright (C) 1995-2005 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h
 *
 * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
 * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
 * tables for updating the shift register in one step with three exclusive-ors
 * instead of four steps with four exclusive-ors.  This results in about a
 * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
 */

/* @(#) $Id$ */

/*
  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
  protection on the static variables used to control the first-use generation
  of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should
  first call get_crc_table() to initialize the tables before allowing more than
  one thread to use crc32().
 */

#ifdef MAKECRCH
#  include <stdio.h>
#  ifndef DYNAMIC_CRC_TABLE
#    define DYNAMIC_CRC_TABLE
#  endif /* !DYNAMIC_CRC_TABLE */
#endif /* MAKECRCH */

#include "zutil.h"      /* for STDC and FAR definitions */

#define local static

/* Find a four-byte integer type for crc32_little() and crc32_big(). */
#ifndef NOBYFOUR
#  ifdef STDC           /* need ANSI C limits.h to determine sizes */
#    include <limits.h>
#    define BYFOUR
#    if (UINT_MAX == 0xffffffffUL)
       typedef unsigned int u4;
#    else
#      if (ULONG_MAX == 0xffffffffUL)
         typedef unsigned long u4;
#      else
#        if (USHRT_MAX == 0xffffffffUL)
           typedef unsigned short u4;
#        else
#          undef BYFOUR     /* can't find a four-byte integer type! */
#        endif
#      endif
#    endif
#  endif /* STDC */
#endif /* !NOBYFOUR */

/* Definitions for doing the crc four data bytes at a time. */
#ifdef BYFOUR
#  define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
                (((w)&0xff00)<<8)+(((w)&0xff)<<24))
   local unsigned long crc32_little OF((unsigned long,
                        const unsigned char FAR *, unsigned));
   local unsigned long crc32_big OF((unsigned long,
                        const unsigned char FAR *, unsigned));
#  define TBLS 8
#else
#  define TBLS 1
#endif /* BYFOUR */

/* Local functions for crc concatenation */
local unsigned long gf2_matrix_times OF((unsigned long *mat,
                                         unsigned long vec));
local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));

#ifdef DYNAMIC_CRC_TABLE

local volatile int crc_table_empty = 1;
local unsigned long FAR crc_table[TBLS][256];
local void make_crc_table OF((void));
#ifdef MAKECRCH
   local void write_table OF((FILE *, const unsigned long FAR *));
#endif /* MAKECRCH */
/*
  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.

  Polynomials over GF(2) are represented in binary, one bit per coefficient,
  with the lowest powers in the most significant bit.  Then adding polynomials
  is just exclusive-or, and multiplying a polynomial by x is a right shift by
  one.  If we call the above polynomial p, and represent a byte as the
  polynomial q, also with the lowest power in the most significant bit (so the
  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
  where a mod b means the remainder after dividing a by b.

  This calculation is done using the shift-register method of multiplying and
  taking the remainder.  The register is initialized to zero, and for each
  incoming bit, x^32 is added mod p to the register if the bit is a one (where
  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
  x (which is shifting right by one and adding x^32 mod p if the bit shifted
  out is a one).  We start with the highest power (least significant bit) of
  q and repeat for all eight bits of q.

  The first table is simply the CRC of all possible eight bit values.  This is
  all the information needed to generate CRCs on data a byte at a time for all
  combinations of CRC register values and incoming bytes.  The remaining tables
  allow for word-at-a-time CRC calculation for both big-endian and little-
  endian machines, where a word is four bytes.
*/
local void make_crc_table()
{
    unsigned long c;
    int n, k;
    unsigned long poly;                 /* polynomial exclusive-or pattern */
    /* terms of polynomial defining this crc (except x^32): */
    static volatile int first = 1;      /* flag to limit concurrent making */
    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};

    /* See if another task is already doing this (not thread-safe, but better
       than nothing -- significantly reduces duration of vulnerability in
       case the advice about DYNAMIC_CRC_TABLE is ignored) */
    if (first) {
        first = 0;

        /* make exclusive-or pattern from polynomial (0xedb88320UL) */
        poly = 0UL;
        for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
            poly |= 1UL << (31 - p[n]);

        /* generate a crc for every 8-bit value */
        for (n = 0; n < 256; n++) {
            c = (unsigned long)n;
            for (k = 0; k < 8; k++)
                c = c & 1 ? poly ^ (c >> 1) : c >> 1;
            crc_table[0][n] = c;
        }

#ifdef BYFOUR
        /* generate crc for each value followed by one, two, and three zeros,
           and then the byte reversal of those as well as the first table */
        for (n = 0; n < 256; n++) {
            c = crc_table[0][n];
            crc_table[4][n] = REV(c);
            for (k = 1; k < 4; k++) {
                c = crc_table[0][c & 0xff] ^ (c >> 8);
                crc_table[k][n] = c;
                crc_table[k + 4][n] = REV(c);
            }
        }
#endif /* BYFOUR */

        crc_table_empty = 0;
    }
    else {      /* not first */
        /* wait for the other guy to finish (not efficient, but rare) */
        while (crc_table_empty)
            ;
    }

#ifdef MAKECRCH
    /* write out CRC tables to crc32.h */
    {
        FILE *out;

        out = fopen("crc32.h", "w");
        if (out == NULL) return;
        fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
        fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
        fprintf(out, "local const unsigned long FAR ");
        fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
        write_table(out, crc_table[0]);
#  ifdef BYFOUR
        fprintf(out, "#ifdef BYFOUR\n");
        for (k = 1; k < 8; k++) {
            fprintf(out, "  },\n  {\n");
            write_table(out, crc_table[k]);
        }
        fprintf(out, "#endif\n");
#  endif /* BYFOUR */
        fprintf(out, "  }\n};\n");
        fclose(out);
    }
#endif /* MAKECRCH */
}

#ifdef MAKECRCH
local void write_table(out, table)
    FILE *out;
    const unsigned long FAR *table;
{
    int n;

    for (n = 0; n < 256; n++)
        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ", table[n],
                n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
}
#endif /* MAKECRCH */

#else /* !DYNAMIC_CRC_TABLE */
/* ========================================================================
 * Tables of CRC-32s of all single-byte values, made by make_crc_table().
 */
#include "crc32.h"
#endif /* DYNAMIC_CRC_TABLE */

/* =========================================================================
 * This function can be used by asm versions of crc32()
 */
const unsigned long FAR * ZEXPORT get_crc_table()
{
#ifdef DYNAMIC_CRC_TABLE
    if (crc_table_empty)
        make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */
    return (const unsigned long FAR *)crc_table;
}

/* ========================================================================= */
#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1

/* ========================================================================= */
unsigned long ZEXPORT crc32(crc, buf, len)
    unsigned long crc;
    const unsigned char FAR *buf;
    unsigned len;
{
    if (buf == Z_NULL) return 0UL;

#ifdef DYNAMIC_CRC_TABLE
    if (crc_table_empty)
        make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */

#ifdef BYFOUR
    if (sizeof(void *) == sizeof(ptrdiff_t)) {
        u4 endian;

        endian = 1;
        if (*((unsigned char *)(&endian)))
            return crc32_little(crc, buf, len);
        else
            return crc32_big(crc, buf, len);
    }
#endif /* BYFOUR */
    crc = crc ^ 0xffffffffUL;
    while (len >= 8) {
        DO8;
        len -= 8;
    }
    if (len) do {
        DO1;
    } while (--len);
    return crc ^ 0xffffffffUL;
}

#ifdef BYFOUR

/* ========================================================================= */
#define DOLIT4 c ^= *buf4++; \
        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4

/* ========================================================================= */
local unsigned long crc32_little(crc, buf, len)
    unsigned long crc;
    const unsigned char FAR *buf;
    unsigned len;
{
    register u4 c;
    register const u4 FAR *buf4;

    c = (u4)crc;
    c = ~c;
    while (len && ((ptrdiff_t)buf & 3)) {
        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
        len--;
    }

    buf4 = (const u4 FAR *)(const void FAR *)buf;
    while (len >= 32) {
        DOLIT32;
        len -= 32;
    }
    while (len >= 4) {
        DOLIT4;
        len -= 4;
    }
    buf = (const unsigned char FAR *)buf4;

    if (len) do {
        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
    } while (--len);
    c = ~c;
    return (unsigned long)c;
}

/* ========================================================================= */
#define DOBIG4 c ^= *++buf4; \
        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4

/* ========================================================================= */
local unsigned long crc32_big(crc, buf, len)
    unsigned long crc;
    const unsigned char FAR *buf;
    unsigned len;
{
    register u4 c;
    register const u4 FAR *buf4;

    c = REV((u4)crc);
    c = ~c;
    while (len && ((ptrdiff_t)buf & 3)) {
        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
        len--;
    }

    buf4 = (const u4 FAR *)(const void FAR *)buf;
    buf4--;
    while (len >= 32) {
        DOBIG32;
        len -= 32;
    }
    while (len >= 4) {
        DOBIG4;
        len -= 4;
    }
    buf4++;
    buf = (const unsigned char FAR *)buf4;

    if (len) do {
        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
    } while (--len);
    c = ~c;
    return (unsigned long)(REV(c));
}

#endif /* BYFOUR */

#define GF2_DIM 32      /* dimension of GF(2) vectors (length of CRC) */

/* ========================================================================= */
local unsigned long gf2_matrix_times(mat, vec)
    unsigned long *mat;
    unsigned long vec;
{
    unsigned long sum;

    sum = 0;
    while (vec) {
        if (vec & 1)
            sum ^= *mat;
        vec >>= 1;
        mat++;
    }
    return sum;
}

/* ========================================================================= */
local void gf2_matrix_square(square, mat)
    unsigned long *square;
    unsigned long *mat;
{
    int n;

    for (n = 0; n < GF2_DIM; n++)
        square[n] = gf2_matrix_times(mat, mat[n]);
}

/* ========================================================================= */
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
    uLong crc1;
    uLong crc2;
    z_off_t len2;
{
    int n;
    unsigned long row;
    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */
    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */

    /* degenerate case */
    if (len2 == 0)
        return crc1;

    /* put operator for one zero bit in odd */
    odd[0] = 0xedb88320L;           /* CRC-32 polynomial */
    row = 1;
    for (n = 1; n < GF2_DIM; n++) {
        odd[n] = row;
        row <<= 1;
    }

    /* put operator for two zero bits in even */
    gf2_matrix_square(even, odd);

    /* put operator for four zero bits in odd */
    gf2_matrix_square(odd, even);

    /* apply len2 zeros to crc1 (first square will put the operator for one
       zero byte, eight zero bits, in even) */
    do {
        /* apply zeros operator for this bit of len2 */
        gf2_matrix_square(even, odd);
        if (len2 & 1)
            crc1 = gf2_matrix_times(even, crc1);
        len2 >>= 1;

        /* if no more bits set, then done */
        if (len2 == 0)
            break;

        /* another iteration of the loop with odd and even swapped */
        gf2_matrix_square(odd, even);
        if (len2 & 1)
            crc1 = gf2_matrix_times(odd, crc1);
        len2 >>= 1;

        /* if no more bits set, then done */
    } while (len2 != 0);

    /* return combined crc */
    crc1 ^= crc2;
    return crc1;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久性| 国产精品区一区二区三区| 中文在线资源观看网站视频免费不卡| 午夜精品视频在线观看| 99re66热这里只有精品3直播| 国产精品蜜臀av| 日本黄色一区二区| 亚洲国产中文字幕| 日韩三级高清在线| 国产成人亚洲综合色影视| 国产欧美精品一区二区色综合| av在线这里只有精品| 1区2区3区精品视频| 欧美日韩免费电影| 美女爽到高潮91| 国产精品国产三级国产有无不卡| 94-欧美-setu| 视频一区欧美精品| 国产拍揄自揄精品视频麻豆| 色中色一区二区| 青青草国产成人av片免费| 久久综合狠狠综合久久综合88 | 91精品午夜视频| 久久99国产精品久久99果冻传媒| 国产欧美精品一区| 精品视频一区三区九区| 九九**精品视频免费播放| 亚洲视频在线观看三级| 日韩一区二区三区电影在线观看 | 中文字幕一区av| 欧美乱妇一区二区三区不卡视频 | 成人亚洲一区二区一| 一区二区三区日韩精品视频| 日韩一二三区不卡| 色婷婷狠狠综合| 国产精品中文字幕一区二区三区| 亚洲一区二区成人在线观看| 久久久精品tv| 日韩亚洲欧美高清| 色哟哟亚洲精品| 国产91精品一区二区| 日产欧产美韩系列久久99| 国产精品丝袜在线| 日韩免费高清视频| 欧美三级乱人伦电影| 丁香婷婷综合网| 麻豆成人久久精品二区三区红 | 亚洲一区免费在线观看| 精品国产成人在线影院| 欧美亚洲综合网| 成人激情黄色小说| 国产永久精品大片wwwapp| 亚洲风情在线资源站| 亚洲天堂2016| 国产欧美一区二区三区在线老狼| 日韩欧美一区二区三区在线| 在线欧美日韩精品| av一区二区久久| 丰满少妇久久久久久久| 国产成人精品一区二区三区网站观看| 亚洲国产精品久久人人爱| 中文字幕一区三区| 国产偷国产偷亚洲高清人白洁| 欧美一区二区三区免费在线看| 欧美在线色视频| 欧洲精品在线观看| 91精彩视频在线观看| 99久久er热在这里只有精品66| 国产精品77777| 国产精品一二三四五| 国产精品一区二区不卡| 激情久久久久久久久久久久久久久久| 免费日本视频一区| 亚洲成av人片在线观看| 亚洲成人7777| 天堂成人国产精品一区| 亚洲成人综合在线| 青青草精品视频| 麻豆国产精品一区二区三区| 久久精品国产免费| 国产中文字幕精品| 国产成人午夜精品5599| 国产不卡一区视频| av一区二区久久| 欧美亚洲综合网| 欧美一区二区成人6969| 日韩精品中文字幕一区二区三区| 精品欧美一区二区久久| 精品电影一区二区三区| 欧美zozozo| 中文字幕va一区二区三区| 成人免费视频在线观看| 亚洲一区二区三区在线看| 午夜精品久久久久久久蜜桃app| 青青草91视频| 国产精品自拍在线| 91亚洲国产成人精品一区二三 | 欧美日韩在线三区| 91麻豆精品国产91久久久使用方法| 欧美日韩视频一区二区| 日韩小视频在线观看专区| 久久亚洲精品国产精品紫薇| 国产精品久久久久久久午夜片 | 久久老女人爱爱| 亚洲手机成人高清视频| 亚洲制服欧美中文字幕中文字幕| 日韩电影网1区2区| 国产伦精品一区二区三区免费迷 | 久久精品国产一区二区三区免费看| 国产精品小仙女| 日本久久一区二区| 日韩精品综合一本久道在线视频| 欧美激情一区二区三区| 亚洲电影你懂得| 丁香桃色午夜亚洲一区二区三区| 欧美无人高清视频在线观看| 日韩欧美一级精品久久| 成人免费在线播放视频| 日本强好片久久久久久aaa| 福利电影一区二区| 4438x亚洲最大成人网| 国产精品久久久久久亚洲毛片 | 久久一日本道色综合| 亚洲日本电影在线| 蜜芽一区二区三区| youjizz久久| 精品对白一区国产伦| 亚洲成人在线免费| 成人黄色在线看| 精品日韩欧美在线| 亚洲成av人片在线观看无码| 成人一区二区三区| 91精品国产色综合久久| 成人免费一区二区三区视频| 激情五月婷婷综合| 欧美另类videos死尸| 亚洲欧洲av色图| 国产精品456露脸| 欧美一区二区精品在线| 亚洲一区视频在线| 99久久99久久久精品齐齐| 久久亚洲一区二区三区四区| 日日夜夜免费精品视频| 91老司机福利 在线| 国产免费成人在线视频| 国产在线观看一区二区| 欧美一激情一区二区三区| 亚洲成人精品一区二区| 91香蕉国产在线观看软件| 国产网站一区二区| 国产一区二区三区视频在线播放| 欧美一区二区视频在线观看2022| 亚洲卡通动漫在线| 成人18视频在线播放| 欧美激情在线一区二区| 国产福利一区二区三区在线视频| 欧美大尺度电影在线| 婷婷国产v国产偷v亚洲高清| 欧美网站一区二区| 亚洲国产成人精品视频| 欧美性猛片aaaaaaa做受| 亚洲精品综合在线| 91国内精品野花午夜精品| 亚洲婷婷综合色高清在线| 成人app软件下载大全免费| 国产精品毛片久久久久久久| 国产精品69久久久久水密桃| 国产偷v国产偷v亚洲高清| 国产成a人无v码亚洲福利| 欧美国产乱子伦| 99热国产精品| 亚洲欧美日韩一区二区 | 秋霞av亚洲一区二区三| 欧美tickling挠脚心丨vk| 蜜桃精品在线观看| 久久日韩粉嫩一区二区三区| 国产成人亚洲精品青草天美| 日本一区二区电影| 91污片在线观看| 亚洲一区免费观看| 91精品中文字幕一区二区三区| 麻豆精品视频在线| 久久先锋影音av鲁色资源网| 成人永久aaa| 一区二区三区免费观看| 在线中文字幕不卡| 三级久久三级久久| 久久亚洲精华国产精华液 | 国产精品1024| 亚洲视频资源在线| 制服丝袜中文字幕一区| 久久国产精品无码网站| 国产网红主播福利一区二区| 97精品视频在线观看自产线路二| 一区二区三区.www| 日韩欧美精品三级| 成人性色生活片| 亚洲va欧美va天堂v国产综合| 欧美一级理论片| 成人h动漫精品一区二区|