Skip to content

Instantly share code, notes, and snippets.

@4np
Created January 24, 2013 13:20
Show Gist options
  • Save 4np/4621489 to your computer and use it in GitHub Desktop.
Save 4np/4621489 to your computer and use it in GitHub Desktop.
Generate the md5, sha and RMD160 sums for a particular file. Very useful for create new Portfiles for Macports as a portfile validates these particular checksums for downloaded files. Usage: portsums /path/to/file.tgz
# hash methods
rmd160() {
openssl dgst -rmd160 $1
}
portsums() {
echo 'MD5 : '`md5 $1`
echo 'SHA : '`shasum $1`
echo 'RMD160 : '`rmd160 $1`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment