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