#336 · Developer Tool

SRI Hash Generator

Generate Subresource Integrity digests from the exact bytes of a script, stylesheet, or other text resource. Select SHA-256, SHA-384, SHA-512, or all three, and the page uses the browser Web Crypto implementation to produce standards-compatible base64 integrity tokens. Byte counts and digest lengths are shown alongside the output. Hash the deployed file bytes, including whitespace and line endings, because any change produces a different token.

Developer Input

Resource content
Ad space

How to use this developer tool

  1. Paste the resource content or load the included sample.
  2. Adjust any tool-specific option shown below the input.
  3. Select Generate SRI Hash or press Ctrl/Cmd + Enter.
  4. Review the summary and findings, then copy or download the output.

What this developer tool does

UTF-8 encodes the supplied text, computes the selected SHA-2 digest with crypto.subtle.digest, and formats it as algorithm-base64.

UTF-8 encodes the supplied text, computes the selected SHA-2 digest with crypto.subtle.digest, and formats it as algorithm-base64.

SRI proves fetched bytes match the token. It does not establish that the original code is trustworthy.

Example

Input

console.log("Loaded with integrity checking");

Output

sha384-BASE64_DIGEST

Use cases

  • Review a deployment before changing production response headers.
  • Compare application and reverse-proxy configuration.
  • Create a reproducible finding for a security review or pull request.
  • Teach the practical effect of SRI Hash settings.

Tips for reliable output

  • Use the complete header value, including repeated fields.
  • Test the final response after CDN and proxy processing.
  • Keep a copy of the before and after output for review.
  • Do not treat a passing result as a penetration test.
  • Recheck after framework, server, or browser-policy updates.

Processing details

The text box is encoded as UTF-8. Uploaded text files are decoded by the browser before hashing, so use a byte-preserving workflow for non-UTF-8 or binary assets.

This page cannot fetch a remote CDN URL. Paste the exact resource or upload a text file; binary assets are outside the text input workflow.

Frequently asked questions

Why does one whitespace change produce a different SRI hash?

The checker reports this directly from the supplied resource content and shows the relevant value in its output.

Should I use SHA-256, SHA-384, or SHA-512 for SRI?

Use the result together with the browser and server behavior you support; the page does not make remote requests.

Can an SRI integrity attribute contain multiple hashes?

Review the generated finding before deployment, especially when proxies or CDNs can alter headers.

Does the generator download and hash a remote CDN file?

The implemented rule follows current HTTP security-header practice and flags values it cannot recognize.

Is an SRI digest the same as a digital signature?

Retest with the exact production response because small header changes can affect the conclusion.

Checks and output

StageWhat is reported
ParseRecognized input fields and values
ValidateInvalid, missing, or conflicting settings
ExportText, CSV, and JSON when structured data is available

HTTP & Security Headers

Browse more tools for HTTP behavior, browser policies, cookies, CORS, CSP, and response-header security.

View HTTP & Security Headers