๐ก๏ธ SRI Hash Generator (integrity attribute)
The hash is calculated directly from the text pasted into the box (file upload is not supported).
Enter content
Generate the integrity attribute value used by Subresource Integrity (SRI) โ a browser feature that detects tampering in externally-loaded resources via <script> or <link> tags โ from a piece of text content. Everything runs entirely in your browser.
How to use
- Paste the content (JS or CSS source code) you want to hash.
- Choose a hash algorithm (SHA-256, SHA-384, or SHA-512).
- Copy the generated integrity attribute value into your <script> or <link> tag.
FAQ
What is Subresource Integrity (SRI)?
A mechanism that lets the browser verify that a JS/CSS file loaded from a CDN or other external source hasn't been tampered with. If the integrity attribute's hash doesn't match the actual fetched file's hash, the browser refuses to load the resource.
Is the generated value specific to that exact file?
Yes โ the hash depends on the file's exact content, so even a single-byte change produces a completely different value. Always regenerate the integrity attribute whenever you update the file.
Which algorithm should I choose?
The SRI spec allows SHA-256, SHA-384, or SHA-512. SHA-384 is the most commonly used, though you can also list multiple algorithms space-separated.