Think before you speak, read before you think.

Linux下计算MD5和SHA1

计算MD5 – md5sum

# md5sum QQ2011.exe
 2b68bc86016a6204096db7f0f8d06541  QQ2011.exe

计算SHA1 – sha1sum

# sha1sum QQ2011.exe
 73229f7b44368e8f468f91b1ad13959e0cfa405e  QQ2011.exe

如果要计算admin的sha1sum值,使用如下命令,其中-n表示不输出换行符

echo -n 'admin' | sha1sum

php计算md5值

$str='20141016hoopchina.com.cnhoopchina_P5ea8hoopchina_MsY#5';
echo md5($str);

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *