Crates.io | checksum |
lib.rs | checksum |
version | 0.2.1 |
source | src |
created_at | 2016-02-19 03:34:13.883354 |
updated_at | 2016-12-23 18:30:36.133767 |
description | Calculates crc32/crc64 file checksums written in Rust |
homepage | |
repository | https://github.com/BrunoMacias/checksum-rs.git |
max_upload_size | |
id | 4212 |
size | 8,185 |
Calculates CRC32/CRC64 file checksums written in Rust. CRC32 uses the IEEE polynomial 0xEDB88320 by default and CRC64 uses the ECMA polynomial 0xC96C5795D7870F42
extern crate checksum;
use checksum::crc::Crc as crc;
use std::env;
pub fn main() {
let filename: &str = &env::args().nth(2).unwrap()[..];
let mut crc = crc::new(filename);
match crc.checksum() {
Ok(checksum) => {
println!("CRC32: {:X}", checksum.crc32);
println!("CRC64: {:X}", checksum.crc64);
}
Err(e) => {
println!("{}", e);
}
}
}
MIT