internal static uint Calculate(Stream stream) { // Copy the stream to a memory steam and get get the CRC32 of the bytes using (var memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); return(Crc32.Calculate(memoryStream.ToArray())); } }
public static bool ContentEquals(this Stream stream, Stream otherStream) { return(Crc32.Calculate(stream) == Crc32.Calculate(otherStream)); }