DEV Community

Robert Rees
Robert Rees

Posted on • Edited on

How to find an SRI hash on jsdelivr

Sub-resource integrity hashes are something that make using content from public CDNs that little be more secure but the common ones don't make it easy to find out what the hash should be.

jsdelivr is used in the Bootstrap documentation but the quickstart unhelpfully doesn't include the SRI by default.

The simplest way to get the hash is to search for the package you're using via the search function on the main site. You can then get an option to copy the SRI to your clipboard as one of the options from the Install box.

However you can also see the value in the jsdeliver API by taking the resource path and replacing the start with https://data.jsdelivr.com/v1/package/ and removing the path element relating to the distributed file. This will show the all the API information for the entire package including the hash (which is SHA 256). See the Bootstrap entry as an example.

Heroku

Deliver your unique apps, your own way.

Heroku tackles the toil — patching and upgrading, 24/7 ops and security, build systems, failovers, and more. Stay focused on building great data-driven applications.

Learn More

Top comments (0)

Sentry image

Make it make sense

Only the context you need to fix your broken code with Sentry.

Start debugging →

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay