Skip to main content

encode_hash

Function encode_hash 

Source
pub fn encode_hash(
    algorithm: &str,
    encoding: &str,
    bytes: &[u8],
) -> Result<String, SpecError>
Expand description

Re-encode a hash to the requested encoding. algorithm is stamped into the output for prefixed encodings (<alg>:<...> or SRI).

§Errors

SpecError::Interp { phase: "hash-encode" } if the encoding name isn’t recognised.