bitcoin_mass_address_generator 0.1.0

A high-performance multithreaded Bitcoin HD wallet address generator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use once_cell::sync::Lazy;
use rand::SeedableRng;
use rand_chacha::ChaCha20Rng;
use std::cell::RefCell;
use std::io::BufRead;
use std::sync::Arc;

thread_local! {
    pub static THREAD_RNG: RefCell<ChaCha20Rng> = RefCell::new(ChaCha20Rng::from_entropy());
}

// Static global wordlist
pub static WORDLIST: Lazy<Arc<Vec<String>>> = Lazy::new(|| {
    let file = std::fs::File::open("wordlist.txt").expect("wordlist.txt missing");
    let reader = std::io::BufReader::new(file);
    Arc::new(reader.lines().collect::<Result<_, _>>().expect("Invalid wordlist"))
});