pub fn from_hex_upper(alg: Algorithm, s: &str) -> Result<Hash, Error> {
        if s.is_empty() {
            return Ok(Hash::None);
        }
        match alg {
            Algorithm::Sha256 => {
                let mut h = [0u8; SHA256_HASH_SIZE];
                Hex::upper_case()
                    .decode_to_slice(s.as_bytes(), &mut h)
                    .map_err(Error::subtle_encoding)?;
                Ok(Hash::Sha256(h))
            }
        }
    }
/// Decode a `Hash` from upper-case hexadecimal
Decode a `Hash` from upper-case hexadecimal
Decode a ` Hash ` from upper - case hexadecimal
pub fn from_hex_upper(alg: Algorithm, s: &str) -> Result<Hash, Error> {
        if s.is_empty() {
            return Ok(Hash::None);
        }
        match alg {
            Algorithm::Sha256 => {
                let mut h = [0u8; SHA256_HASH_SIZE];
                Hex::upper_case()
                    .decode_to_slice(s.as_bytes(), &mut h)
                    .map_err(Error::subtle_encoding)?;
                Ok(Hash::Sha256(h))
            }
        }
    }
pub fn from_hex_upper ( alg : Algorithm , s : & str ) -> Result < Hash , Error > { if s . is_empty ( ) { return Ok ( Hash :: None ) ; } match alg { Algorithm :: Sha256 => { let mut h = [ 0u8 ; SHA256_HASH_SIZE ] ; Hex :: upper_case ( ) . decode_to_slice ( s . as_bytes ( ) , & mut h ) . map_err ( Error :: subtle_encoding ) ? ; Ok ( Hash :: Sha256 ( h ) ) } } }
Decode a `Hash` from upper-case hexadecimal
Decode a ` Hash ` from upper - case hexadecimal
alg
Algorithm
s
&str