Skip to content
AI Web Toolbox

Security

Practical guide: Subresource Integrity Generator

Use Subresource Integrity Generator when you need a quick way to work through this task. Generate an SRI hash for a script or stylesheet. This guide walks through a small example and the checks to make before you use the result.

Subresource Integrity lets a browser compare downloaded script or stylesheet bytes with an expected digest. This is useful for pinned CDN assets whose content should not change unexpectedly.

How to use the tool

  1. Open the tool and start with the worked example below.
  2. Paste the contents of a JS/CSS file to get its `integrity="sha384-..."` attribute for safer CDN loading.
  3. Verify the result against the example before using it in your project.
Open Subresource Integrity Generator

Try a small example

Example input or settings

A public versioned CSS file containing body { color: #333; }

What to check

Generate an integrity value from the exact contents of a public CSS file. Test the attribute in a page; changing even whitespace requires a new digest.

Does SRI make any third-party script trustworthy?

No. It verifies matching bytes, not whether those bytes are safe. Cross-origin resources also need compatible CORS configuration.

When this is useful

For a real task, replace the sample with your own input and check the output in its final context. Keep a copy of the original if the change is hard to reverse.

Before you rely on the result

Use disposable examples when testing. Keep real secrets private, verify the result independently and review security settings for your application.

Browse all guides