{
  "id": "sri_hash",
  "kind": "datatype",
  "status": "draft",
  "name": "Subresource Integrity (SRI) hash",
  "doc": "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.",
  "is_pii": false,
  "categories": [
    "cryptography",
    "internet"
  ],
  "langs": [
    "common"
  ],
  "classification": "identifier",
  "regexp": "^(?:sha256-[A-Za-z0-9+/]{43}=|sha384-[A-Za-z0-9+/]{64}|sha512-[A-Za-z0-9+/]{86}==)$",
  "examples": [
    {
      "value": "sha384-H8BRh8j48O9oYatfu5AZzq6A9RINhZO5H16dQZngK7T62em8MUt1FLm52t+eX6xO",
      "description": "Example of the W3C specification: digest of the script alert('Hello, world.');",
      "valid": true
    },
    {
      "value": "sha256-qznLcsROx4GACP2dm0UCKCzCG+HiZ1guq6ZZDob/Tng=",
      "description": "SHA-256 integrity value of the same script",
      "valid": true
    },
    {
      "value": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270",
      "description": "OCI content digest (hexadecimal, colon)",
      "valid": false
    }
  ],
  "links": [
    {
      "type": "doc",
      "url": "https://www.w3.org/TR/sri/"
    },
    {
      "type": "other",
      "url": "https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity"
    },
    {
      "type": "wikipedia",
      "url": "https://en.wikipedia.org/wiki/Subresource_Integrity"
    }
  ],
  "quality": {
    "score": 75,
    "missing": [
      "mapping (Wikidata, Schema.org, ...)",
      "translation",
      "detector coverage"
    ]
  },
  "source": {
    "path": "data/datatypes/any/cryptography/sri_hash.yaml",
    "url": "https://github.com/apicrafter/metacrafter-registry/blob/main/data/datatypes/any/cryptography/sri_hash.yaml",
    "edit_url": "https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/cryptography/sri_hash.yaml"
  },
  "urls": {
    "html": "http://registry.apicrafter.io/datatype/sri_hash",
    "json": "http://registry.apicrafter.io/api/v1/datatypes/sri_hash.json"
  }
}