Go to file
Bensuperpc e85e254599
Update code
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2023-03-02 19:44:07 +01:00
.github/workflows Fix doc 2022-03-08 16:55:34 +01:00
cmake Fix doc 2022-03-08 16:55:34 +01:00
docs Big update (See commit details) 2021-11-19 13:50:24 +01:00
example Big update (See commit details) 2021-11-19 13:50:24 +01:00
include/crc32 Update code 2023-03-02 19:44:07 +01:00
source Update code 2023-03-02 19:44:07 +01:00
test Fix Debug error 2022-03-08 17:00:30 +01:00
tools Big update (See commit details) 2021-11-19 13:50:24 +01:00
.clang-format Big update (See commit details) 2021-11-19 13:50:24 +01:00
.clang-tidy Big update (See commit details) 2021-11-19 13:50:24 +01:00
.codespellrc Update CMake-init N°1 2022-03-08 16:04:27 +01:00
.gitignore Big update (See commit details) 2021-11-19 13:50:24 +01:00
BUILDING.md Update CMake-init N°1 2022-03-08 16:04:27 +01:00
CMakeLists.txt Update code 2022-06-19 00:05:00 +02:00
CMakePresets.json Update code 2022-06-19 00:05:00 +02:00
CODE_OF_CONDUCT.md Big update (See commit details) 2021-11-19 13:50:24 +01:00
CONTRIBUTING.md Big update (See commit details) 2021-11-19 13:50:24 +01:00
Crc32.ino zlib style license 2013-04-25 11:07:53 +02:00
Crc32Best.ino zlib style license 2013-04-25 11:07:53 +02:00
HACKING.md Update CMake-init N°1 2022-03-08 16:04:27 +01:00
LICENSE set up GitHub mirror 2018-08-09 16:40:34 +02:00
Makefile Update code 2022-06-19 00:05:00 +02:00
README.md Update README.md 2022-03-30 19:39:09 +02:00
changelog.md version 9: added support for multithreaded calculation 2019-12-06 22:46:39 +01:00
crc32.js version 4: added javascript port 2014-08-19 10:36:41 +02:00

README.md

Fast CRC32

Fast CRC32 library, based on the work of Stephan Brumme (https://create.stephan-brumme.com/crc32/).

Continuous Integration Dockcross CI

linux windows macos

Features

  • C99 and C++11 support (C++17 recommended, eg std::string_view ...)
  • CMake support (3.14 minimal or 3.19 with preset)
  • The fastest algorithms need about 1 CPU cycle per byte
  • Endian-aware
  • Support for multi-threaded computation
  • Multi OS support: Linux 32/64, MacOS, Windows 32/64, Android 32/64
  • Cross-plateform support: AMD64, I386, ARMv8, ARMv7, ARMv6, ARMv5, RISC-V 32/64, PPC64le, Mips, m68k..
  • Runs even on Arduino, Raspberry Pi, etc.
  • More info https://create.stephan-brumme.com/crc32/

Algorithms

Functions version Published by CPU cycles/byte Bits/iter Table size MB/s
bitwise_branch / crc32::bitwise_branch 1.0.0 unknown 100 1 - 170
bitwise / crc32::bitwise 1.0.0 unknown 50 or 40 1 - 190
half-byte / crc32::half-byte 1.0.0 unknown 14 4 64 bytes 263
crc32_1byte / crc32::crc32_1byte 1.0.0 Hagai Gold 8 8 1 KB 522
crc32_1byte_tableless / crc32::crc32_1byte_tableless 1.0.0 Henry S. Warren 18 8 - 300
crc32_1byte_tableless2 / crc32::crc32_1byte_tableless2 1.0.0 Dilip V. Sarwate 19 8 - 170
crc32_4bytes / crc32::crc32_4bytes 1.0.0 Intel Corp. 3 or 4 32 4 KB 1458
crc32_8bytes / crc32::crc32_8bytes 1.0.0 Intel Corp. 3 or 4 64 8 KB 2629
crc32_4x8bytes / crc32::crc32_4x8bytes 1.0.0 ? 1.75 or 2.25 256 8 KB 3003
crc32_16bytes / crc32::crc32_16bytes 1.0.0 Bulat Ziganshin 1.1 or 1.5 128 16 KB 6027
crc32_16bytes_prefetch / crc32::crc32_16bytes_prefetch 1.0.0 Bulat Ziganshin 1 or 1.5 512 16 KB 6102
crc32_fast / crc32::crc32_fast 1.0.0 None varies varies varies varies

Tested on Lenovo Legion 5 Pro:

  • Manjaro 21.1.6
  • Clang 12.0.1
  • Build type: Release
  • CPU: AMD R7 5800H
  • RAM: 32 GB DDR4 3200Mhz 22CL 8x
  • Data: 1 GB

Others function

  • crc32_combine() "merges" two indepedently computed CRC32 values which is the basis for even faster multi-threaded calculation

See my website https://create.stephan-brumme.com/crc32/ for documentation, code examples and a benchmark.

Building and installing

See the BUILDING document.

Contributing

See the CONTRIBUTING document.

Open source projects used

Licensing

See the LICENSE document.