Skip to content

Instantly share code, notes, and snippets.

@johnryan1982
Last active April 3, 2020 10:40
Show Gist options
  • Save johnryan1982/6478f347fbb68e5b18505e3f7de3b7da to your computer and use it in GitHub Desktop.
Save johnryan1982/6478f347fbb68e5b18505e3f7de3b7da to your computer and use it in GitHub Desktop.
MD5 hash verification of input strings
#!/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