Created
October 8, 2018 14:16
-
-
Save JBaczuk/ab8be89f7aa8756ae54ffec27e62e417 to your computer and use it in GitHub Desktop.
SHA 256
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Command Line parsing | |
####################### | |
if [[ $# -lt 1 ]]; then | |
echo "Usage: $ sha256 <input-hex>" | |
exit 1 | |
fi | |
inputHex=$1 | |
printf $inputHex | xxd -r -p | openssl sha256 | cut -c 10- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment