How do I do a SHA1 File Checksum in C#?

前端 未结 4 1281
鱼传尺愫
鱼传尺愫 2020-11-27 12:45

How do I use the SHA1CryptoServiceProvider() on a file to create a SHA1 Checksum of the file?

4条回答
  •  孤街浪徒
    2020-11-27 12:57

    Also you can try:

    FileStream fop = File.OpenRead(@"C:\test.bin");
    string chksum = BitConverter.ToString(System.Security.Cryptography.SHA1.Create().ComputeHash(fop));
    

提交回复
热议问题