1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//! High-performance CRC checksums.
//!
//! This module provides implementations of common CRC algorithms with automatic
//! hardware acceleration on supported platforms.
//!
//! # Supported Algorithms
//!
//! | Type | Polynomial | Output | Use Cases |
//! |------|------------|--------|-----------|
//! | `Crc16Ccitt` | 0x1021 | `u16` | X.25, HDLC, PACTOR, SD |
//! | `Crc16Ibm` | 0x8005 | `u16` | Legacy protocols, ARC/IBM |
//! | `Crc24OpenPgp` | 0x864CFB | `u32` (24-bit) | OpenPGP (RFC 4880) |
//! | `Crc32` | 0x04C11DB7 | `u32` | Ethernet, gzip, zip, PNG |
//! | `Crc32C` | 0x1EDC6F41 | `u32` | iSCSI, SCTP, ext4, Btrfs |
//! | `Crc64` | 0x42F0E1EBA9EA3693 | `u64` | XZ Utils, 7-Zip |
//! | `Crc64Nvme` | 0xAD93D23594C93659 | `u64` | NVMe specification |
//!
//! # Examples
//!
//! ```rust
//! use rscrypto::checksum::{Checksum, ChecksumCombine, Crc32};
//!
//! // One-shot computation (fastest for complete data)
//! let data = b"123456789";
//! let crc = Crc32::checksum(data);
//! assert_eq!(crc, 0xCBF4_3926);
//!
//! // Streaming computation
//! let mut hasher = Crc32::new();
//! hasher.update(b"1234");
//! hasher.update(b"56789");
//! assert_eq!(hasher.finalize(), crc);
//!
//! // Parallel combine (useful for multi-threaded processing)
//! let (a, b) = data.split_at(4);
//! let crc_a = Crc32::checksum(a);
//! let crc_b = Crc32::checksum(b);
//! let combined = Crc32::combine(crc_a, crc_b, b.len());
//! assert_eq!(combined, crc);
//! ```
//!
//! # Feature Selection
//!
//! ```toml
//! [dependencies]
//! # Smallest CRC-32-only build
//! rscrypto = { version = "0.1", default-features = false, features = ["crc32"] }
//!
//! # All checksum families
//! rscrypto = { version = "0.1", default-features = false, features = ["checksums"] }
//! ```
//!
//! # API Conventions
//!
//! - All checksum types implement [`crate::traits::Checksum`] with `new` / `update` / `finalize` /
//! `reset`.
//! - One-shot checksum entry points use `Type::checksum(data)`.
//! - CRC families that support parallel folding also implement [`crate::traits::ChecksumCombine`]
//! with `Type::combine(left, right, right_len)`.
//!
//! # Advanced
//!
//! Dispatch is automatic by default.
//!
//! - Use [`crate::checksum::config`] for force/config controls.
//! - Use `crate::checksum::introspect` (requires `diag` feature) for kernel reporting and selection
//! details.
//! - Use [`crate::platform`] for platform detection and override control.
//!
//! # no_std Support
//!
//! This module is `no_std` compatible. Disable the `std` feature for embedded use:
//!
//! ```toml
//! [dependencies]
//! rscrypto = { version = "0.1", default-features = false, features = ["crc32"] }
//! ```
// Internal macros must be declared before modules that use them.
pub
pub
/// Advanced checksum configuration and force-mode controls.
// Re-export public types
pub use ;
pub use Crc24OpenPgp;
pub use ;
pub use ;
// Re-export I/O adapters (requires std)
pub use ;
// Re-export traits for convenience
pub use crate;