SHA256.HashData Method

Definition

Overloads

HashData(Byte[])

Computes the hash of data using the SHA256 algorithm.

HashData(ReadOnlySpan<Byte>)

Computes the hash of data using the SHA256 algorithm.

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

Computes the hash of data using the SHA256 algorithm.

HashData(Byte[])

Computes the hash of data using the SHA256 algorithm.

public:
 static cli::array <System::Byte> ^ HashData(cli::array <System::Byte> ^ source);
public static byte[] HashData (byte[] source);
static member HashData : byte[] -> byte[]
Public Shared Function HashData (source As Byte()) As Byte()

Parameters

source
Byte[]

The data to hash.

Returns

Byte[]

The hash of the data.

Exceptions

source is null.

Applies to

HashData(ReadOnlySpan<Byte>)

Computes the hash of data using the SHA256 algorithm.

public:
 static cli::array <System::Byte> ^ HashData(ReadOnlySpan<System::Byte> source);
public static byte[] HashData (ReadOnlySpan<byte> source);
static member HashData : ReadOnlySpan<byte> -> byte[]
Public Shared Function HashData (source As ReadOnlySpan(Of Byte)) As Byte()

Parameters

source
ReadOnlySpan<Byte>

The data to hash.

Returns

Byte[]

The hash of the data.

Applies to

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

Computes the hash of data using the SHA256 algorithm.

public:
 static int HashData(ReadOnlySpan<System::Byte> source, Span<System::Byte> destination);
public static int HashData (ReadOnlySpan<byte> source, Span<byte> destination);
static member HashData : ReadOnlySpan<byte> * Span<byte> -> int
Public Shared Function HashData (source As ReadOnlySpan(Of Byte), destination As Span(Of Byte)) As Integer

Parameters

source
ReadOnlySpan<Byte>

The data to hash.

destination
Span<Byte>

The buffer to receive the hash value.

Returns

Int32

The total number of bytes written to destination.

Exceptions

The buffer in destination is too small to hold the calculated hash size. The SHA256 algorithm always produces a 256-bit hash, or 32 bytes.

Applies to