HMACMD5.HashData Method

Definition

Overloads

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

Computes the HMAC of a stream using the MD5 algorithm.

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

Computes the HMAC of data using the MD5 algorithm.

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

Computes the HMAC of data using the MD5 algorithm.

HashData(Byte[], Stream)

Computes the HMAC of a stream using the MD5 algorithm.

HashData(Byte[], Byte[])

Computes the HMAC of data using the MD5 algorithm.

HashData(ReadOnlySpan<Byte>, Stream)

Computes the HMAC of a stream using the MD5 algorithm.

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

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Computes the HMAC of a stream using the MD5 algorithm.

C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static int HashData(ReadOnlySpan<byte> key, System.IO.Stream source, Span<byte> destination);

Parameters

key
ReadOnlySpan<Byte>

The HMAC key.

source
Stream

The stream to HMAC.

destination
Span<Byte>

The buffer to receive the HMAC value.

Returns

The total number of bytes written to destination.

Attributes

Exceptions

source is null.

The buffer in destination is too small to hold the calculated HMAC size. The MD5 algorithm always produces a 128-bit HMAC, or 16 bytes.

-or-

source does not support reading.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8, 9

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

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Computes the HMAC of data using the MD5 algorithm.

C#
public static byte[] HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source);
C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static byte[] HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source);

Parameters

key
ReadOnlySpan<Byte>

The HMAC key.

source
ReadOnlySpan<Byte>

The data to HMAC.

Returns

Byte[]

The HMAC of the data.

Attributes

Applies to

.NET 9 and other versions
Product Versions
.NET 6, 7, 8, 9

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

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Computes the HMAC of data using the MD5 algorithm.

C#
public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination);
C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination);

Parameters

key
ReadOnlySpan<Byte>

The HMAC key.

source
ReadOnlySpan<Byte>

The data to HMAC.

destination
Span<Byte>

The buffer to receive the HMAC value.

Returns

The total number of bytes written to destination.

Attributes

Exceptions

The buffer in destination is too small to hold the calculated hash size. The MD5 algorithm always produces a 128-bit HMAC, or 16 bytes.

Applies to

.NET 9 and other versions
Product Versions
.NET 6, 7, 8, 9

HashData(Byte[], Stream)

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Computes the HMAC of a stream using the MD5 algorithm.

C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static byte[] HashData(byte[] key, System.IO.Stream source);

Parameters

key
Byte[]

The HMAC key.

source
Stream

The stream to HMAC.

Returns

Byte[]

The HMAC of the data.

Attributes

Exceptions

key or source is null.

source does not support reading.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8, 9

HashData(Byte[], Byte[])

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Computes the HMAC of data using the MD5 algorithm.

C#
public static byte[] HashData(byte[] key, byte[] source);
C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static byte[] HashData(byte[] key, byte[] source);

Parameters

key
Byte[]

The HMAC key.

source
Byte[]

The data to HMAC.

Returns

Byte[]

The HMAC of the data.

Attributes

Exceptions

key or source is null.

Applies to

.NET 9 and other versions
Product Versions
.NET 6, 7, 8, 9

HashData(ReadOnlySpan<Byte>, Stream)

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Computes the HMAC of a stream using the MD5 algorithm.

C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static byte[] HashData(ReadOnlySpan<byte> key, System.IO.Stream source);

Parameters

key
ReadOnlySpan<Byte>

The HMAC key.

source
Stream

The stream to HMAC.

Returns

Byte[]

The HMAC of the data.

Attributes

Exceptions

source is null.

source does not support reading.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8, 9