Last active
April 3, 2020 10:40
-
-
Save johnryan1982/6478f347fbb68e5b18505e3f7de3b7da to your computer and use it in GitHub Desktop.
MD5 hash verification of input strings
This file contains 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
#!/usr/bin/env bash | |
if [[ $# -eq 0 ]] ; then | |
echo -e "\n\tUsage: ${0} {site} {username}" | |
echo -e "\n\tExamples:" | |
echo -e "\n\t\t${0} nickelodeon.com spongebobsquarepants@nick.tv" | |
echo -e "\n\t\t${0} btsport.com stevieG\n" | |
exit 0 | |
fi | |
_site_=`echo ${1} | xargs` | |
_username_=`echo ${2} | xargs` | |
_custom_str_=${_site_}/${_username_} | |
HASH=`md5 -s "${_custom_str_}" | cut -d= -f2 | xargs` | |
echo -e "\n\t${_custom_str_}: ${HASH}\n" | |
echo ${HASH} | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment