Class Crc32
Calculates a 32bit Cyclic Redundancy Checksum (CRC) using the same polynomial used by Zip.
Inheritance
System.Object
Crc32
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.BaseLibrary.IO
Assembly: EPiServer.BaseLibrary.dll
Version: 7.19.2Syntax
public static class Crc32
Methods
GetCrc32(Byte[])
Declaration
public static long GetCrc32(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data |
Returns
Type | Description |
---|---|
System.Int64 |
GetCrc32(FileInfo)
Declaration
public static long GetCrc32(FileInfo file)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileInfo | file |
Returns
Type | Description |
---|---|
System.Int64 |
GetCrc32(Stream)
Returns the CRC32 for the specified stream.
Declaration
public static long GetCrc32(Stream input)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | input | The stream over which to calculate the CRC32 |
Returns
Type | Description |
---|---|
System.Int64 | the CRC32 calculation |
GetCrc32AndCopy(Stream, Stream, out Int32)
Returns the CRC32 for the specified stream, and optionally writes the input into the output stream.
Declaration
public static long GetCrc32AndCopy(Stream input, Stream output, out int totalBytesRead)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | input | |
System.IO.Stream | output | |
System.Int32 | totalBytesRead |
Returns
Type | Description |
---|---|
System.Int64 |