Exemplo n.º 1
0
 public static uint Crc32(byte[] bytes)
 {
     if (bytes == null)
     {
         throw new ArgumentNullException("bytes");
     }
     using (Crc32Algorithm crc32Algorithm = new Crc32Algorithm())
     {
         return(NetBitConverter.ToUInt32(crc32Algorithm.ComputeHash(bytes), 0));
     }
 }
Exemplo n.º 2
0
 public static uint Crc32(Stream inputStream)
 {
     if (inputStream == null)
     {
         throw new ArgumentNullException("inputStream");
     }
     using (Crc32Algorithm crc32Algorithm = new Crc32Algorithm())
     {
         return(NetBitConverter.ToUInt32(crc32Algorithm.ComputeHash(inputStream), 0));
     }
 }