Function nix_compat::nixhash::from_sri_str

source ·
pub fn from_sri_str(s: &str) -> NixHashResult<NixHash>
Expand description

Parses a Nix SRI string to a NixHash. Contrary to the SRI spec, Nix doesn’t have an understanding of passing multiple hashes (with different algos) in SRI hashes. It instead simply cuts everything off after the expected length for the specified algo, and tries to parse the rest in permissive base64 (allowing missing padding).