Crc32.Hash Method

Definition

Overloads

Hash(Byte[])

Computes the CRC-32 hash of the provided data.

Hash(ReadOnlySpan<Byte>)

Computes the CRC-32 hash of the provided data.

Hash(ReadOnlySpan<Byte>, Span<Byte>)

Computes the CRC-32 hash of the provided data into the provided destination.

Hash(Byte[])

Source:
Crc32.cs
Source:
Crc32.cs

Computes the CRC-32 hash of the provided data.

public static byte[] Hash (byte[] source);

Parameters

source
Byte[]

The data to hash.

Returns

Byte[]

The CRC-32 hash of the provided data.

Exceptions

source is null.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Hash(ReadOnlySpan<Byte>)

Source:
Crc32.cs
Source:
Crc32.cs

Computes the CRC-32 hash of the provided data.

public static byte[] Hash (ReadOnlySpan<byte> source);

Parameters

source
ReadOnlySpan<Byte>

The data to hash.

Returns

Byte[]

The CRC-32 hash of the provided data.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Hash(ReadOnlySpan<Byte>, Span<Byte>)

Source:
Crc32.cs
Source:
Crc32.cs

Computes the CRC-32 hash of the provided data into the provided destination.

public static int Hash (ReadOnlySpan<byte> source, Span<byte> destination);

Parameters

source
ReadOnlySpan<Byte>

The data to hash.

destination
Span<Byte>

The buffer that receives the computed hash value.

Returns

The number of bytes written to destination.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)