Generate Subresource Integrity hashes so browsers refuse to run a CDN script or stylesheet that's been altered. Paste the file's contents or drop the files, choose SHA-256, SHA-384 or SHA-512, and copy the integrity value or a complete <script> or <link> tag.
| Part | Example |
|---|---|
| Algorithm prefix | sha384- |
| Digest | Base64 of the raw hash bytes |
| Multiple | sha256-… sha384-… |
An integrity attribute with a hash; the browser blocks the file if its contents don't match.
SHA-384 is the usual choice. You can include several.
You must hash the exact bytes served — different line endings, minification or versions change the hash.
Yes, for files from another origin, and the CDN must send Access-Control-Allow-Origin.
No. They're hashed in your browser.
The exact bytes of the file — or the pasted text encoded as UTF-8 — are hashed with the browser's Web Crypto SHA-256, SHA-384 or SHA-512, and the raw digest (not its hex form) is Base64-encoded and prefixed with the algorithm, e.g. sha384-…, as the W3C Subresource Integrity specification requires. Several algorithms can be listed in one integrity attribute; browsers use the strongest they support. The tag builder adds crossorigin="anonymous", which cross-origin resources need for the browser to check integrity at all, and picks <link rel="stylesheet"> for .css URLs and <script> otherwise. Files and folders can be dropped for batch hashing.