Subresource Integrity (SRI) hash
ID sri_hash
DatatypeNot PIIidentifierDraft
This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).
Integrity metadata of W3C Subresource Integrity, as written in the integrity attribute of HTML script and link elements: the hash algorithm (sha256, sha384 or sha512), a hyphen and the Base64 digest of the resource. An integrity attribute may hold several such values separated by spaces; the regexp matches one.
- Categories
- Cryptographic identifiers, Internet
- Countries
- Global (not tied to a country)
- Languages
- Common to most languages
- Quality
- 75/100 · missing: mapping (Wikidata, Schema.org, ...), translation, detector coverage
- Metacrafter rules
- no detection rule yet
- Supported by tools
- no tool record lists this type yet
Regular expression
^(?:sha256-[A-Za-z0-9+/]{43}=|sha384-[A-Za-z0-9+/]{64}|sha512-[A-Za-z0-9+/]{86}==)$
Python re syntax.
Examples
| Value | Description |
|---|---|
| sha384-H8BRh8j48O9oYatfu5AZzq6A9RINhZO5H16dQZngK7T62em8MUt1FLm52t+eX6xO | Example of the W3C specification: digest of the script alert('Hello, world.'); |
| sha256-qznLcsROx4GACP2dm0UCKCzCG+HiZ1guq6ZZDob/Tng= | SHA-256 integrity value of the same script |
| sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270 invalid | OCI content digest (hexadecimal, colon) |
Sources
- doc: https://www.w3.org/TR/sri/
- other: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
- wikipedia: https://en.wikipedia.org/wiki/Subresource_Integrity
Use this record
- Page URL:
http://registry.apicrafter.io/datatype/sri_hash - JSON: API v1 · legacy shape (used by metacrafter) · Markdown (for LLMs)
- Improve it: edit
data/datatypes/any/cryptography/sri_hash.yamlon GitHub