1234567891011121314151617181920 |
- 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::<()>();
- }
|