A `const fn` implementation of the crc32 checksum algorithm.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jonathan Strong 5dbfa46a34 adds readme; tweak code example 2 years ago
src adds readme; tweak code example 2 years ago
.gitignore initial commit 2 years ago
Cargo.toml adds readme; tweak code example 2 years ago
LICENSE initial commit 2 years ago
README.md adds readme; tweak code example 2 years ago

README.md

const-crc32

A const fn crc32 checksum implementation.

Examples

const BYTES: &[u8] = "The quick brown fox jumps over the lazy dog".as_bytes();
const CKSUM: u32 = const_crc32::crc32(BYTES);
assert_eq!(CKSUM, 0x414fa339_u32);

Usage

This is a naive implementation that should be expected to have poor performance if used on dynamic data at runtime. Usage should generally be restricted to declaring const variables based on static or const data available at build time.