1个不稳定版本

使用旧的Rust 2015

0.1.1 2016年4月21日
0.1.0 2016年4月21日

#crc中排名第33

Download history 536/week @ 2024-03-13 508/week @ 2024-03-20 528/week @ 2024-03-27 484/week @ 2024-04-03 442/week @ 2024-04-10 454/week @ 2024-04-17 799/week @ 2024-04-24 503/week @ 2024-05-01 457/week @ 2024-05-08 523/week @ 2024-05-15 406/week @ 2024-05-22 534/week @ 2024-05-29 480/week @ 2024-06-05 522/week @ 2024-06-12 469/week @ 2024-06-19 393/week @ 2024-06-26

每月下载量达1,988
15个crate中使用(直接使用4个)

MIT许可

4KB
52

rust-crc8

CRC8实现

用法

extern crate crc8;
use crc8::*;

fn main() {
        let buff : [u8; 3] = [1, 2, 3];

        /* Init Crc8 module for given polynomial in regular bit order. */
        let mut crc8 = Crc8::create_lsb(130);

        /* calculate a crc8 over the given input data.
         * pbuffer: pointer to data buffer.
         * length: number of bytes in data buffer.
         * crc:	previous returned crc8 value.
        */
        let mut crc = crc8.calc(&buff, 3, 0);
        println!("crc8: {}", crc);

        /* Init Crc8 module for given polynomial in reverse bit order. */
        crc8 = Crc8::create_msb(130);
        crc = crc8.calc(&buff, 3, 0);
        println!("crc8: {}", crc);
}

无运行时依赖