CentralCSP
APITools

Generate a Subresource Integrity hash

Fetches a script or stylesheet and returns the integrity value to put on its tag, so the browser refuses the file if it ever changes. Requires no authentication.

POST
/v1/tools/sri

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

url*string

URL of the script or stylesheet to hash.

Formaturi
Length1 <= length

Response Body

application/json

curl -X POST "https://api-next.centralcsp.com/v1/tools/sri" \  -H "Content-Type: application/json" \  -d '{    "url": "https://cdn.example.com/app.js"  }'
{}