Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/solidsnack/sonnenbrille
Rust implementation of CRC-8 with user-configurable polynomial
https://github.com/solidsnack/sonnenbrille
Last synced: about 1 month ago
JSON representation
Rust implementation of CRC-8 with user-configurable polynomial
- Host: GitHub
- URL: https://github.com/solidsnack/sonnenbrille
- Owner: solidsnack
- Created: 2021-10-21T01:43:48.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-11T21:31:54.000Z (about 1 year ago)
- Last Synced: 2024-10-31T11:58:55.071Z (about 2 months ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sonnenbrille
*["Sonnenbrille, die -- Brille mit dunkel getönten Gläsern, die die
Augen vor zu starker Helligkeit des Sonnenlichts schützen soll"][sb]*
-- Duden[sb]: https://www.duden.de/rechtschreibung/Sonnenbrille
*"Sunglasses, feminine -- Glasses with dark-toned lenses, that protect
the eyes from bright sunlight"*There are many articles, references and online resources for the Cyclic
Redundancy Check, but I was surprised and greatly helped by the clarity
and comprehensiveness of [Sunshine 2K][s2k]'s
*[Understanding and implementing CRC (Cyclic Redundancy Check)
calculation][U]*. Along with the author's [online implementation][JS],
this illuminating article made it possible for me to understand,
implement and test an 8-bit CRC calculator in Rust.[s2k]: http://www.sunshine2k.de/
[U]: http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html
[JS]: http://www.sunshine2k.de/coding/javascript/crc/crc_js.html```rs
extern crate sonnenbrille;
use sonnenbrille::CRC8;fn crc8(num: u32): u8 {
let calculator = CRC8::default();
return calculator.of(&num.to_be_bytes(), 0x00);
}fn main() {
let num: u32 = 0x31313233;
let calculator = CRC8::default();
let checksum = calculator.of(&num.to_be_bytes(), 0x00);
assert_eq!(checksum, 0x7F);
}
```