Skip to content

Instantly share code, notes, and snippets.

@JBaczuk
Created October 8, 2018 14:16
Show Gist options
  • Save JBaczuk/ace378e68e391b293fe5352f3053c192 to your computer and use it in GitHub Desktop.
Save JBaczuk/ace378e68e391b293fe5352f3053c192 to your computer and use it in GitHub Desktop.
Ripemd 160 Hash
#!/bin/bash
## Command Line parsing
#######################
if [[ $# -lt 1 ]]; then
echo "Usage: $ hash160 <input-hex>"
exit 1
fi
inputHex=$1
hash1="$(printf $inputHex | xxd -r -p | openssl sha256 | cut -c 10-)"
printf $hash1 | xxd -r -p | openssl ripemd160 | cut -c 10-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment