如何使用SHA1或者MD5校验文件完整性
by Elton on 七.04, 2010, under Linux, Mac
有时候当你下载了一个大的文件,但是不知道这个文件是否完整的时候,可以使用提供下载者公布的md5或者sha1码来校验你所下载的文件是否跟下载提供着提供的文件完全一致。
如果你使用的是Mac OSX,UNIX或者Linux,可以使用以下命令来做这个工作:
1 2 | /usr/bin/openssl sha1 [full path to file] /usr/bin/openssl md5 [full path to file] |
第一条命令是使用sha1来校验文件,第二条是使用md5来校验。 校验后会得到类似于如下的结果:
1 2 | /usr/bin/openssl md5 sample.iso MD5(sample.iso)= 3be75df53e0cfb3905af0b4f4471c9f3 |
等号后面的就是对应的MD5的值,你可以跟下载提供着公布的MD5值进行比对,如果完全一致,那么恭喜你,你所下载的文件跟下载提供者的文件一模一样。
2 Comments for this entry
1 Trackback or Pingback for this entry
-
CHRISTOPHER
七月 7th, 2010 on 05:06Buy:Zetia.Amoxicillin.Ventolin.Zocor.Acomplia.Benicar.Nymphomax.Seroquel.Wellbutrin SR.Female Pink Viagra.SleepWell.Buspar.Lipothin.Advair.Prozac.Cozaar.Aricept.Lipitor.Lasix.Female Cialis….



七月 5th, 2010 on 14:30
This is what I need, thank you!!!
十月 15th, 2010 on 17:24
What a fantastic post! Thanks for sharing it on your blog.