Skip to content

Instantly share code, notes, and snippets.

@amacal
Created November 5, 2020 07:34
Show Gist options
  • Save amacal/411ef38fd314f46d32ddab418b3f95e1 to your computer and use it in GitHub Desktop.
Save amacal/411ef38fd314f46d32ddab418b3f95e1 to your computer and use it in GitHub Desktop.
if [ ! -f "$1" ]; then
exit 1
fi
SHA=`cat $1 | openssl dgst -binary -sha256 | openssl base64`
BIN=`cat $1 | openssl dgst -sha256 | awk '{print $2}'`
echo "{ \"filebase64sha256\": \"$SHA\", \"binary\": \"$BIN\", \"status\": \"success\" }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment