1 unstable release

Uses old Rust 2015

0.1.1 Apr 21, 2016
0.1.0 Apr 21, 2016

#78 in #crc

Download history 365/week @ 2024-07-22 336/week @ 2024-07-29 389/week @ 2024-08-05 748/week @ 2024-08-12 596/week @ 2024-08-19 471/week @ 2024-08-26 860/week @ 2024-09-02 571/week @ 2024-09-09 375/week @ 2024-09-16 871/week @ 2024-09-23 772/week @ 2024-09-30 863/week @ 2024-10-07 984/week @ 2024-10-14 1146/week @ 2024-10-21 1201/week @ 2024-10-28 1163/week @ 2024-11-04

4,528 downloads per month
Used in 15 crates (4 directly)

MIT license

4KB
52 lines

rust-crc8

A CRC8 implementation

Usage

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);
}

No runtime deps