Subresource Integrity lets a page declare the expected cryptographic hash of a static external script or stylesheet. If the downloaded bytes do not match, the browser refuses the resource.
Generate the fingerprint with the SRI hash generator and keep the integrity value synchronized with the exact file version. The crossorigin behavior must also match how the resource is served.
SRI is useful for versioned CDN assets, but it is not a universal third-party security system. Frequently changing resources are awkward to pin, and SRI does not decide whether the code you approved is safe. It verifies integrity of expected bytes, not trustworthiness.
For the broader distinction between hashes and authenticity, continue with hashes and integrity.