rustywallet_batch/lib.rs
1//! # rustywallet-batch
2//!
3//! High-performance batch key generation for cryptocurrency wallets.
4//!
5//! This crate provides efficient APIs for generating large batches of private keys
6//! with parallel processing, SIMD optimization, and memory-efficient streaming.
7//!
8//! ## Features
9//!
10//! - **Batch Generation**: Generate millions of keys efficiently
11//! - **Parallel Processing**: Utilize all CPU cores with rayon
12//! - **Memory Streaming**: Process unlimited keys without memory exhaustion
13//! - **Incremental Scanning**: Scan key ranges using EC point addition
14//! - **Configurable**: Flexible configuration for different use cases
15//!
16//! ## Quick Start
17//!
18//! ```rust
19//! use rustywallet_batch::prelude::*;
20//!
21//! // Generate 1000 keys in parallel
22//! let keys = BatchGenerator::new()
23//! .count(1000)
24//! .parallel()
25//! .generate_vec()
26//! .unwrap();
27//!
28//! println!("Generated {} keys", keys.len());
29//! ```
30//!
31//! ## Streaming Large Batches
32//!
33//! ```rust
34//! use rustywallet_batch::prelude::*;
35//!
36//! // Stream keys without storing all in memory
37//! let stream = BatchGenerator::new()
38//! .count(1_000_000)
39//! .generate()
40//! .unwrap();
41//!
42//! for key in stream.take(100) {
43//! println!("{}", key.unwrap().to_hex());
44//! }
45//! ```
46//!
47//! ## Incremental Key Scanning
48//!
49//! ```rust
50//! use rustywallet_batch::prelude::*;
51//! use rustywallet_keys::prelude::PrivateKey;
52//!
53//! // Scan from a base key
54//! let base = PrivateKey::from_hex(
55//! "0000000000000000000000000000000000000000000000000000000000000001"
56//! ).unwrap();
57//!
58//! let scanner = KeyScanner::new(base)
59//! .direction(ScanDirection::Forward);
60//!
61//! for key in scanner.scan_range(10) {
62//! println!("{}", key.unwrap().to_hex());
63//! }
64//! ```
65//!
66//! ## Configuration Presets
67//!
68//! ```rust
69//! use rustywallet_batch::prelude::*;
70//!
71//! // Fast mode - maximum speed
72//! let config = BatchConfig::fast();
73//!
74//! // Balanced mode - good speed with reasonable memory
75//! let config = BatchConfig::balanced();
76//!
77//! // Memory efficient - minimal memory usage
78//! let config = BatchConfig::memory_efficient();
79//! ```
80
81pub mod config;
82pub mod error;
83pub mod fast_gen;
84pub mod generator;
85pub mod prelude;
86pub mod scanner;
87pub mod stream;
88
89#[cfg(test)]
90mod tests;
91
92// Re-export main types at crate root
93pub use config::BatchConfig;
94pub use error::BatchError;
95pub use fast_gen::{FastKeyGenerator, IncrementalKeyGenerator};
96pub use generator::BatchGenerator;
97pub use scanner::{KeyScanner, ScanDirection};
98pub use stream::KeyStream;