Skip to content

Instantly share code, notes, and snippets.

@JBaczuk
Created August 14, 2018 19:36
Show Gist options
  • Save JBaczuk/eb8aec1ceb68029530c563dbdd9debaf to your computer and use it in GitHub Desktop.
Save JBaczuk/eb8aec1ceb68029530c563dbdd9debaf to your computer and use it in GitHub Desktop.
HASH256 (Double SHA256)
#!/bin/bash
## Command Line parsing
#######################
if [[ $# -lt 1 ]]; then
echo "Usage: $ hash256 <input-hex>"
exit 1
fi
inputHex=$1
hash1="$(printf $inputHex | xxd -r -p | openssl sha256 | cut -c 10-)"
printf $hash1 | 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