Use following HomeBrew command to install md5sum & sha1sum
brew install md5sha1sum
You can use ‘md5sum’ as below:
#Create a new file using echo.
root# echo hello>>testfile.txt
#Find md5 has for the created file.
root# md5sum testfile.txt
b1946ac92492d2347c6235b4d2611184 testfile.txt
Mac OS X also provides an inbuilt ‘md5’ utility which has similar functionality as ‘md5sum’. You can use ‘md5’ with ‘-r’ switch to get similar output as ‘md5sum’.
root# md5 testfile.txt
MD5 (testfile.txt) = b1946ac92492d2347c6235b4d2611184
root# md5 -r testfile.txt
b1946ac92492d2347c6235b4d2611184 testfile.txt