Skip to content

Instantly share code, notes, and snippets.

@davidraedev
Created November 10, 2017 02:43
Show Gist options
  • Save davidraedev/9c0b51947f730ce56491e11158270967 to your computer and use it in GitHub Desktop.
Save davidraedev/9c0b51947f730ce56491e11158270967 to your computer and use it in GitHub Desktop.
subresource integrity hash, local and remote wget or curl
# local
echo 'sha384-'"$( cat FILENAME | openssl dgst -sha384 -binary | openssl enc -base64 -A )";
# wget
echo 'sha384-'"$( wget -o/dev/null -O- URL_HERE | openssl dgst -sha384 -binary | openssl enc -base64 -A )";
# curl
echo 'sha384-'"$( curl -s URL_HERE | openssl dgst -sha384 -binary | openssl enc -base64 -A )";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment