使用旧版 Rust 2015
0.2.0 |
|
---|---|
0.1.0 |
|
#10 在 #crc64
53KB
1K SLoC
CRC64
Rust 中的 5 行* CRC64 实现。
*: 是的,我有点作弊 。这是 antirez 对 Redis 的 CRC64 算法的实现,基本上就是一个巨大的表。有关使用的确切常量,请参阅 lib.rs。
构建
cargo build --release
用法
作为库
use crc64::crc64;
crc64::crc64(0, "123456789".as_bytes());
作为独立应用程序
$ ./target/release/crc64 src/crc64/lib.rs
测试
使用以下命令运行测试
cargo test
贡献
如果您发现错误或想以其他方式提供帮助,请 提交问题。