perl -MDigest::MD5=md5_hex -e '$/="\0"; while(<>){chomp; print "$_\0".md5_hex($_)."\0"}' in.file > out.file