如何计算 .NET 中字符串的 CRC32(循环冗余校验和)?
最佳答案
这家伙似乎有你的答案。
https://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net
如果博客消失或破坏了 url,这里是 github 链接:
博客文章中 Crc32 类的用法:
Crc32 crc32 = new Crc32();
String hash = String.Empty;
using (FileStream fs = File.Open("c:\\myfile.txt", FileMode.Open))
foreach (byte b in crc32.ComputeHash(fs)) hash += b.ToString("x2").ToLower();
Console.WriteLine("CRC-32 is {0}", hash);
关于.net - 如何计算字符串的CRC32,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8128/