Integrity Attribute Parser
Split integrity metadata into supported SHA algorithm tokens, digest text, and options, reporting unsupported or malformed tokens separately.
Description
An integrity attribute can hold several algorithm/digest tokens and optional metadata options.
An integrity attribute can hold several algorithm/digest tokens and optional metadata options. Separating recognized tokens from ignored text makes malformed declarations visible.1
Split integrity metadata into supported SHA algorithm tokens, digest text, and options, reporting unsupported or malformed tokens separately.
When to use Integrity Attribute Parser
Use this tool to split integrity metadata into supported SHA algorithm tokens, digest text, and options, reporting unsupported or malformed tokens separately.
Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
How to use Integrity Attribute Parser and understand its results
- Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
- Enter integrity using the field table and calculation rules, then run the tool.
- Read metadata, ignored. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| integrity | HTML integrity attribute value. | string; maximum length: 1000000 | Required |
Paste the attribute value. Split on ASCII whitespace and match case-sensitive supported algorithm names, nonempty Base64-like digest characters with up to two ending equals signs, and optional printable options. Return matched records and ignored tokens in their respective order. Empty input produces two empty lists.
metadata=recognized sha256/sha384/sha512-digest[?options] tokens; ignored=remaining tokens Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| metadata | Supported integrity metadata. | list of object; minimum entries: 0; maximum entries: 100000 |
| ignored | Unsupported or malformed integrity tokens. | list of string; maximum length: 1000000; minimum entries: 0; maximum entries: 100000 |
{
"input": {
"integrity": "sha256-YWJj sha384-ZGVm?foo=bar md5-aaa"
},
"output": {
"metadata": [
{
"algorithm": "sha256",
"digest": "YWJj",
"options": ""
},
{
"algorithm": "sha384",
"digest": "ZGVm",
"options": "foo=bar"
}
],
"ignored": [
"md5-aaa"
]
}
} Limitations and assumptions
This is lexical parsing, not digest decoding or verification: digest byte lengths and canonical Base64 are not checked. It does not select the strongest algorithm or fetch resource bytes.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use Subresource Integrity Hash Generator: Hash explicit UTF-8 text with SHA-256, SHA-384, or SHA-512 and emit Base64 Subresource Integrity metadata. For a complementary task, use ModulepreloadDetector: Extract modulepreload link hints from HTML source without fetching, validating browser support, or resolving their hrefs.
References
-
Integrity Attribute Parser — tool.io
Similar or alternative tools
- Subresource Integrity Hash Generator
Hash explicit UTF-8 text with SHA-256, SHA-384, or SHA-512 and emit Base64 Subresource Integrity metadata.
- ModulepreloadDetector
Extract modulepreload link hints from HTML source without fetching, validating browser support, or resolving their hrefs.