🍋 Privacy & Security
SRI Hash Generator
Generate Subresource Integrity hashes
chars
words
sentences
lines
SRI Options
Results
Result
About SRI Hash Generator
Generate Subresource Integrity (SRI) hashes for script and link tags. Verify that CDN-hosted resources have not been tampered with.
How It Works
Computes a cryptographic hash (SHA-256, SHA-384, or SHA-512) of your resource content using the Web Crypto API. Generates the full integrity attribute value and complete HTML tags with crossorigin attribute.
Step by Step
- 1 Paste the content of your JS or CSS file
- 2 Select the hash algorithm (SHA-384 recommended)
- 3 Choose output format: integrity attribute or full HTML tag
- 4 Click Generate to compute the SRI hash
- 5 Add the integrity attribute to your HTML tags
Tips
- SHA-384 is recommended by the W3C SRI specification
- Always include crossorigin='anonymous' with SRI
- Regenerate the hash whenever the resource content changes
- SRI only works with resources served over CORS-enabled connections
Frequently Asked Questions
What is Subresource Integrity?
SRI lets browsers verify that resources fetched from CDNs have not been tampered with. If the hash does not match, the browser refuses to execute the resource.
Should I use SRI for all external resources?
Yes, for all scripts and stylesheets loaded from third-party CDNs. It protects against CDN compromise, man-in-the-middle attacks, and supply chain attacks.