SRI SHA 384/512 Support

At the moment, SRIs only supports SHA-256 but they should also support SHA-384.

CDNjs should support SHA-384 since SHA-256 can still be used as a fallback. Here’s an example of how this should be implemented:

<!-- Current format -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
 
<!-- Suggested format -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo= sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh sha512-bnIvzh6FU75ZKxp0GXLH9bewza/OIw6dLVh9ICg0gogclmYGguQJWl8U30WpbsGTqbIiAwxTsbe76DErLq5EDQ==" crossorigin="anonymous"></script>

Hi there @Richienb,

Thanks for the great suggestion, I am totally onboard with adding this. I have opened an issue on our main repository so that other maintainers can share their ideas and thoughts on this: https://github.com/cdnjs/cdnjs/issues/13384

Hope that helps!
- Matt.

I want to work on this but I can’t find any code related to generating SRIs. Could it be that it is some script that Peter runs locally?

Hiya,

Just looked into this as I couldn’t actually find where it was either, it looks like they are generated in https://github.com/cdnjs/cdnjs/blob/master/build/packages.json.js#L205-L237