Crc32CalculateHash(Byte, Int32, Int32, UInt32, UInt32) Method

Computes the CRC-32 hash value for the specified byte array.

Definition

Namespace: KGySoft.Security.Cryptography
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public static uint CalculateHash(
	byte[] buffer,
	int offset,
	int count,
	uint initialCrc = 0,
	uint polynomial = 3988292384
)

Parameters

buffer  Byte
The input to compute the hash code for.
offset  Int32
The offset into the byte array from which to begin using data.
count  Int32
The number of bytes in the array to use as data.
initialCrc  UInt32  (Optional)
The initial CRC value to use. If the final CRC is calculated in more sessions the result of the last calculation can be specified here. This parameter is optional.
Default value: 0.
polynomial  UInt32  (Optional)
The polynomial to use to calculate the CRC value. This parameter is optional.
Default value: StandardPolynomial.

Return Value

UInt32
The CRC-32 hash value of the specified buffer; or, if initialCrc was specified, an accumulated hash value appended by the current buffer.

See Also