Exemple #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));
     }
 }
Exemple #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));
     }
 }