Skip to content

Instantly share code, notes, and snippets.

@lusentis
Created February 13, 2018 14:11
Show Gist options
  • Save lusentis/c57118dd00345757b6123d8f91cfd208 to your computer and use it in GitHub Desktop.
Save lusentis/c57118dd00345757b6123d8f91cfd208 to your computer and use it in GitHub Desktop.
bash alias definition for easy computation of SRI hashes :)
# usage:
# $ curl https://cdn.ravenjs.com/3.22.3/raven.min.js | sri
alias sri='openssl dgst -sha384 -binary | openssl base64 -A | cat <(echo -n "sha384-") - | xsel -bi && echo "SRI hash copied to clipboard :)"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment