⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zcrc32.c

📁 完整的Bell实验室的嵌入式文件系统TFS
💻 C
字号:
/* crc32.c -- compute the CRC-32 of a data stream * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h  */#include "zlib.h"#define local staticextern unsigned long crc32tab[];#define DO1(buf) crc = crc32tab[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);#define DO2(buf)  DO1(buf); DO1(buf);#define DO4(buf)  DO2(buf); DO2(buf);#define DO8(buf)  DO4(buf); DO4(buf);/* ========================================================================= */uLong ZEXPORT zcrc32(crc, buf, len)uLong crc;const Bytef *buf;uInt len;{    if (buf == Z_NULL)        return 0L;    crc = crc ^ 0xffffffffL;    while (len >= 8) {        DO8(buf);        len -= 8;    }    if (len) do {        DO1(buf);    } while (--len);    return crc ^ 0xffffffffL;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -