Highly Reusable Software
Professions, Sciences, Humanities, Business, ...
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...
Conversions, tests, processing, manipulation,...
Integer, Floating point, Matrix, Statistics, Boolean, ...
Algorithms, Memory, Process control, Debugging, ...
Data storage, Integrity, Encryption, Compression, ...
Networks, protocols, Interprocess, Remote, Client Server, ...
Timing, Calendar and Clock, Audio, Video, Printer, Controls...
Management, Filtering, File & Directory access, Viewers, ...
librock_CRC32 - CRC-32 (CCITT standard algorithm) on memory block(s)
#License - #Source code - #Example Use -
librock_uint32_t crc, /* Before first call set = ~0 */
const void *Buffer,
unsigned int cbBuffer
Routine calculates the CRC for a block of data using table lookup method.
It accepts an original value for the crc, and returns the updated value.
The caller must precondition the crc to all 1's before the first call,
and invert the result after all blocks are complete.
Typical use is
librock_uint32_t crccomp = 0xffffffffL;
char *buf = "this is a test";
crccomp = librock_CRC32(crccomp,buf,strlen(buf));
printf("%08lx\n", (crccomp ^ 0xFFFFFFFFL));
// librock_PRIVATE BuildCRCTable()
// librock_PRIVATE unsigned long CRCTable
// librock_PRIVATE char CRCTableBuilt
Copyright 1998-2002 Forrest J. Cavalier III, http://www.mibsoftware.com
Licensed under BSD-ish license, NO WARRANTY. Copies must retain this block.
License text in <librock/license/librock.txt> librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45
./data/integrity/crc32.c (implementation, plus source of this manual page)
Tests and Supported Platform Types
This is a representative sample. Librock code is highly portable. For a particular platform not reported here, request paid support
librock_CRC32 passed tests in tcrc32 (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_CRC32 passed tests in tcrc32 (WIN32: 2002/08/08 sys=NT 4.0 using MSVC)
This software is part of Librock
Rapid reuse, without rework.
- Source code which is Open-source, Free (Libre) and free (no cost)
- Namespace limited. All compile-time macros and names visible at link time are prefixed by "librock_". Integrate into your project and expect no name collisions.
- Stable API means new functions get new names so that there is no risk that updating a source file will break existing applications.
- Highly portable, cross-platform, and multithread compatible. Works with many machines, compilers, and operating systems (gcc/MSVC/Windows/Linux/BSD).
This page copyright (C) 2002-2003 Forrest J. Cavalier III, d-b-a Mib Software, Saylorsburg PA 18353, USA
Verbatim copying and distribution of this generated page is permitted in any medium provided that no changes are made.
(The source of this manual page may be covered by a more permissive license which allows modifications.)
Want to help? We welcome comments, patches. -- Need help? Request paid support.