Simple tool to generate the integrity attribute for subresource integrity.
Let's say you want to use Backbone from this CDN:
https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.3/backbone-min.js
Just pass that address to the tool:
./integrity https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.3/backbone-min.js
And then use the output tu build the script tag:
<script crossorigin="anonymous" integrity="sha384-kgH1F06klaG52/uQEQlpP5QZ9tbJZgcU4omvs1DRSHaJGVZWp//NYtoi93ZmGday" src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.3/backbone-min.js"></script>
Voilà! You're now safe from unexpected manipulation. The resource you asked for is going to be the one you wanted.