Decode a plain digest depending on the hash algo specified externally.
hexlower, nixbase32 and base64 encodings are supported - the encoding is
inferred from the input length.
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).