sbf_blake3/
types.rs

1//! Common types for the SBF data structure
2
3#[cfg(feature = "serde_support")]
4use serde::{Deserialize, Serialize};
5
6/// Salt string type
7///
8/// We use a `u8` encoding for the hash string.
9pub type Salt = Vec<u8>;
10
11/// The kind of hashing function that is used by the data structure
12///
13/// By default only MD5 is enabled, MD4 can be enabled by using the `md4_hash` feature.
14#[derive(Clone, Copy, Debug)]
15#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
16pub enum HashFunction {
17    /// MD5 hash function
18    #[cfg(feature = "md5_hash")]
19    MD5,
20    /// MD4 hash function
21    #[cfg(feature = "md4_hash")]
22    MD4,
23    /// Blake3 hash function
24    #[cfg(feature = "blake3_hash")]
25    Blake3,
26}