Skip to content

Instantly share code, notes, and snippets.

@nolochemical
Created October 3, 2019 16:05
Show Gist options
  • Save nolochemical/4401dccce31153859132c8bc00b12451 to your computer and use it in GitHub Desktop.
Save nolochemical/4401dccce31153859132c8bc00b12451 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# usage:
# $ 384sum ./myModule.js
shasum -b -a 384 $1 | awk '{ print $1 }' | xxd -r -p | base64
@nolochemical
Copy link
Author

Subresource Integrity via Developer.Mozilla.org

Using subresource integrity in web pages.

<script src="https://example.com/example-framework.js" integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC" crossorigin="anonymous"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment