pub fn hash_string(hash_algorithm: HashAlgorithm, input: &str, as_hex: bool) -> String {
    match hash_algorithm {
        HashAlgorithm::MD5 => hash_bytes::<Md5>(input.as_bytes(), as_hex),
        HashAlgorithm::SHA2_256 => hash_bytes::<Sha256>(input.as_bytes(), as_hex),
        HashAlgorithm::SHA2_512 => hash_bytes::<Sha512>(input.as_bytes(), as_hex),
        HashAlgorithm::SHA3_256 => hash_bytes::<Sha3_256>(input.as_bytes(), as_hex),
        HashAlgorithm::SHA3_512 => hash_bytes::<Sha3_512>(input.as_bytes(), as_hex),
        HashAlgorithm::BLAKE2S => hash_bytes::<Blake2s>(input.as_bytes(), as_hex),
        HashAlgorithm::BLAKE2B => hash_bytes::<Blake2b>(input.as_bytes(), as_hex),
        HashAlgorithm::BLAKE3 => blake3_bytes(input.as_bytes(), as_hex),
    }
}
/// Hashes the given string with the selected hash algorithm.
///
/// Option to get the output as hex if `as_hex` is true.

Hashes the given string with the selected hash algorithm.
Option to get the output as hex if `as_hex` is true.
Hashes the given string with the selected hash algorithm . Option to get the output as hex if ` as_hex ` is true .
pub fn hash_string(hash_algorithm: HashAlgorithm, input: &str, as_hex: bool) -> String {
    match hash_algorithm {
        HashAlgorithm::MD5 => hash_bytes::<Md5>(input.as_bytes(), as_hex),
        HashAlgorithm::SHA2_256 => hash_bytes::<Sha256>(input.as_bytes(), as_hex),
        HashAlgorithm::SHA2_512 => hash_bytes::<Sha512>(input.as_bytes(), as_hex),
        HashAlgorithm::SHA3_256 => hash_bytes::<Sha3_256>(input.as_bytes(), as_hex),
        HashAlgorithm::SHA3_512 => hash_bytes::<Sha3_512>(input.as_bytes(), as_hex),
        HashAlgorithm::BLAKE2S => hash_bytes::<Blake2s>(input.as_bytes(), as_hex),
        HashAlgorithm::BLAKE2B => hash_bytes::<Blake2b>(input.as_bytes(), as_hex),
        HashAlgorithm::BLAKE3 => blake3_bytes(input.as_bytes(), as_hex),
    }
}
pub fn hash_string ( hash_algorithm : HashAlgorithm , input : & str , as_hex : bool ) -> String { match hash_algorithm { HashAlgorithm :: MD5 => hash_bytes :: < Md5 > ( input . as_bytes ( ) , as_hex ) , HashAlgorithm :: SHA2_256 => hash_bytes :: < Sha256 > ( input . as_bytes ( ) , as_hex ) , HashAlgorithm :: SHA2_512 => hash_bytes :: < Sha512 > ( input . as_bytes ( ) , as_hex ) , HashAlgorithm :: SHA3_256 => hash_bytes :: < Sha3_256 > ( input . as_bytes ( ) , as_hex ) , HashAlgorithm :: SHA3_512 => hash_bytes :: < Sha3_512 > ( input . as_bytes ( ) , as_hex ) , HashAlgorithm :: BLAKE2S => hash_bytes :: < Blake2s > ( input . as_bytes ( ) , as_hex ) , HashAlgorithm :: BLAKE2B => hash_bytes :: < Blake2b > ( input . as_bytes ( ) , as_hex ) , HashAlgorithm :: BLAKE3 => blake3_bytes ( input . as_bytes ( ) , as_hex ) , } }
Hashes the given string with the selected hash algorithm.
Hashes the given string with the selected hash algorithm .
hash_algorithm
HashAlgorithm
input
&str
as_hex
bool
hash_algorithm
HashAlgorithm
input
&str
as_hex
bool