Skip to content

Instantly share code, notes, and snippets.

@bergginu
Last active January 12, 2022 01:14
Show Gist options
  • Save bergginu/1da44dcec35f85a5cddfa4d044d5756f to your computer and use it in GitHub Desktop.
Save bergginu/1da44dcec35f85a5cddfa4d044d5756f to your computer and use it in GitHub Desktop.
#!/bin/bash
Help()
{
echo 'Computes the md5 hash of a string.'
echo
echo 'Usage:'
echo ' md5 -h'
echo ' md5 string'
echo
}
while getopts ":h" option; do
case $option in
h) #display help
Help
exit;;
esac
done
echo -n $1 | md5sum -t | awk '{print $1}'
@bergginu
Copy link
Author

For Linux SysAdmns that handle MD5 (passwords, i.g.), as a safer alternative than online tools.
A good practice is to put it in the ~/.local/bin directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment