21 lines
506 B
Rust
21 lines
506 B
Rust
extern crate crypto_hash;
|
|
extern crate rayon;
|
|
extern crate memmap;
|
|
|
|
use crypto_hash::{Algorithm, hex_digest};
|
|
use std::fs::File;
|
|
use memmap::MmapOptions;
|
|
use rayon::prelude::*;
|
|
|
|
|
|
pub fn rainbow(file: &str) {
|
|
let file = File::open(file).unwrap();
|
|
let mmap = unsafe { MmapOptions::new().map(&file).unwrap() };
|
|
|
|
mmap.par_split(|c| *c == '\n' as u8)
|
|
.map(|coso| {
|
|
let _hash = hex_digest(Algorithm::MD5, coso);
|
|
// println!("{}", _hash);
|
|
}).collect::<()>();
|
|
}
|