Skip to main content

inline_hash_before_embed

Function inline_hash_before_embed 

Source
pub fn inline_hash_before_embed(
    html: &[u8],
    alg: Algorithm,
    hasher: &impl Hasher,
) -> Vec<u8> 
Expand description

The hash an inline binding will have once a script element is embedded in html, computed before the manifest exists.

The exclusion covers the whole element, so the covered bytes are the document without it — this document. Pair the result with the exclusion compute_data_hash reports after embedding; the two agree.

This is the ordering that makes an inline HTML manifest signable: hash, sign, embed. There is no equivalent for an external manifest, whose link element is inside the hash.