.NET如何计算字符串的CRC32

如何在.NET中计算字符串的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);
日期:2021-06-11 11:24:22 来源:oir作者:oir