4 releases (1 stable)

Uses old Rust 2015

1.0.0 Jan 7, 2016
0.2.2 Apr 3, 2015
0.2.1 Jan 23, 2015
0.2.0 Jan 23, 2015

#377 in Database interfaces

Download history 487/week @ 2021-04-07 503/week @ 2021-04-14 440/week @ 2021-04-21 281/week @ 2021-04-28 722/week @ 2021-05-05 1456/week @ 2021-05-12 1731/week @ 2021-05-19 1657/week @ 2021-05-26 2068/week @ 2021-06-02 2587/week @ 2021-06-09 1660/week @ 2021-06-16 1802/week @ 2021-06-23 1432/week @ 2021-06-30 2283/week @ 2021-07-07 1771/week @ 2021-07-14 2334/week @ 2021-07-21

2,428 downloads per month
Used in 4 crates (3 directly)

BSD-3-Clause

54KB
1K SLoC

CRC64

Build Status crates.io

A 5-line* CRC64 implementation in Rust.

*: Yes, I cheated a bit. It is antirez' implementation of the CRC64 algorithm for Redis, which basically consists of one huge table. See lib.rs for the exact constants used. Oh, since v0.2.0 I cheated even more. It's not 5 lines anymore, more like 25.

Build

cargo build --release

Usage

As a library:

use crc64::crc64;
crc64::crc64(0, "123456789".as_bytes());

As a standalone application:

$ ./target/release/crc64 src/crc64/lib.rs

Tests

Run tests with:

cargo test

Contribute

If you find bugs or want to help otherwise, please open an issue.

License

BSD. See LICENSE.
Redis and the code I used is also released under a BSD license. See crc64.c.

No runtime deps