MD5 Hashing password or text using Perl

Just a small tip I learned from work.

Obtain the MD5 hash of the password using Perl:

$ perl -MDigest::MD5=md5_hex -e"print uc(md5_hex(@ARGV[0]))" hellother3



The uc() means returning the upper case of the result.

print uc(md5_hex(@ARGV[0]))

To return the lower case of the result, use lc() instead:

print lc(md5_hex(@ARGV[0]))

Leave a Reply