SRI Hash Generator (Subresource Integrity)
Generate cryptographic SRI hashes and ready-to-paste script and link tags to protect web applications against CDN tampering.
At a glance
SRI Hash Generator is a free browser tool that generates Subresource Integrity (SRI) hashes and HTML script/link tags online. Full support for recommended SHA-384, high-security SHA-512, and backward-compatible SHA-256 digests. It also validates any existing SRI hash against source code or files to confirm authenticity. Your inputs never leave your device, and there is no sign-up or install.
100% Client-Side SRI Cryptographic Hashing
Hardware-accelerated Web Crypto API. Your proprietary JavaScript code, CSS stylesheets, and CDN files never leave your browser.
Why Use This SRI Hash Generator?
How to Use SRI Hash Generator
Paste Code or Upload File
Enter your JavaScript or CSS source code directly into the editor, or drop your script file into the upload zone.
Configure Algorithm & URL
Select your hash algorithm (SHA-384 recommended) and optionally provide the CDN asset URL.
Copy Integrity Hash or HTML Tag
Copy the generated SRI hash string or the ready-to-paste HTML tag with a single click.
SHA-384 Subresource Integrity Generation
Calculates the Base64-encoded SHA-384 cryptographic digest of the input script code and wraps it in a W3C-compliant HTML script element.
console.log("Hello from secure CDN asset!");
Integrity: sha384-y7d60eD4H8+905e+vE0wL2gQ5c+w8+07rK9/V04+6aQ= Tag: <script src="https://cdn.example.com/app.js" integrity="sha384-..." crossorigin="anonymous"></script>
Technical Specifications & Engine Details
| Specification | Details |
|---|---|
| Supported Formats | JAVASCRIPT, CSS, TEXT, BINARY → HASH, HTML, TEXT |
| Execution Mode | 100% Client-Side In-Browser (client) |
| Browser Requirements | Modern browser with Web Crypto API support. |
| Performance Constraints | Runs 100% client-side via Web Crypto API. Zero code or assets are uploaded to remote servers. |
100% Client-Side Privacy Guarantee
All cryptographic hashing executes client-side using the browser Web Crypto API. No source code or files are ever sent to remote servers.
Frequently Asked Questions
What is Subresource Integrity (SRI)?
Why is SHA-384 recommended over SHA-256 for SRI?
Why is the crossorigin="anonymous" attribute required?
Methodology
This tool runs entirely in your browser. The example above shows a representative input and the result it produces.
Last updated .