oxedyne/fe2o3/fe2o3_hash/src/lib.rs
1.4 KiB, 17 runs
created by r1870400018:355, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | //! A hashing library providing checksums, cryptographic hashes and proof-of-work functionality. |
| 2 | //! |
| 3 | //! This crate is part of the Hematite collection and provides: |
| 4 | //! |
| 5 | //! - Checksum generation and verification through the [`csum`] module |
| 6 | //! - Cryptographic hashing via the [`hash`] module, supporting algorithms like SHA3-256 |
| 7 | //! - Key derivation functions in the [`kdf`] module, implementing Argon2 |
| 8 | //! - A concurrent sharded hashmap in the [`map`] module for high-performance applications |
| 9 | //! - Perceptual image hashing for near-duplicate detection in the [`phash`] module |
| 10 | //! - Proof-of-work mining and verification in the [`pow`] module |
| 11 | //! |
| 12 | //! The crate integrates with Hematite's error handling system and Namex scheme identification, |
| 13 | //! whilst providing generic traits for custom algorithm implementations. |
| 14 | //! |
| 15 | //! # Examples |
| 16 | //! |
| 17 | //! ``` |
| 18 | //! use oxedyne_fe2o3_hash::hash::HashScheme; |
| 19 | //! use oxedyne_fe2o3_iop_hash::api::Hasher; |
| 20 | //! |
| 21 | //! // Create a SHA3-256 hasher. |
| 22 | //! let hasher = HashScheme::new_sha3_256(); |
| 23 | //! let input = b"example data"; |
| 24 | //! |
| 25 | //! // Generate a hash with an empty salt. Hashing consumes the scheme. |
| 26 | //! let hash = hasher.hash(&[input], []); |
| 27 | //! ``` |
| 28 | #![forbid(unsafe_code)] |
| 29 | |
| 30 | use oxedyne_fe2o3_jdat::version::SemVer; |
| 31 | |
| 32 | |
| 33 | pub mod csum; |
| 34 | pub mod map; |
| 35 | pub mod hash; |
| 36 | pub mod kdf; |
| 37 | pub mod phash; |
| 38 | pub mod pow; |
| 39 | pub mod sha256; |
| 40 | |
| 41 | pub const VERSION: SemVer = SemVer::new(0,0,1); |