HMACSHA1.HashData Method

Definition

Overloads

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

Computes the HMAC of a stream using the SHA1 algorithm.

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

Computes the HMAC of data using the SHA1 algorithm.

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

Computes the HMAC of data using the SHA1 algorithm.

HashData(Byte[], Stream)

Computes the HMAC of a stream using the SHA1 algorithm.

HashData(Byte[], Byte[])

Computes the HMAC of data using the SHA1 algorithm.

HashData(ReadOnlySpan<Byte>, Stream)

Computes the HMAC of a stream using the SHA1 algorithm.

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

Source:
HMACSHA1.cs
Source:
HMACSHA1.cs
Source:
HMACSHA1.cs

Computes the HMAC of a stream using the SHA1 algorithm.

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.

Exceptions

source is null.

The buffer in destination is too small to hold the calculated HMAC size. The SHA1 algorithm always produces a 160-bit HMAC, or 20 bytes.

-or-

source does not support reading.

Applies to

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 7, 8, 9

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

Source:
HMACSHA1.cs
Source:
HMACSHA1.cs
Source:
HMACSHA1.cs

Computes the HMAC of data using the SHA1 algorithm.

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.

Applies to

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 6, 7, 8, 9

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

Source:
HMACSHA1.cs
Source:
HMACSHA1.cs
Source:
HMACSHA1.cs

Computes the HMAC of data using the SHA1 algorithm.

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.

Exceptions

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

Applies to

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 6, 7, 8, 9

HashData(Byte[], Stream)

Source:
HMACSHA1.cs
Source:
HMACSHA1.cs
Source:
HMACSHA1.cs

Computes the HMAC of a stream using the SHA1 algorithm.

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.

Exceptions

key or source is null.

source does not support reading.

Applies to

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 7, 8, 9

HashData(Byte[], Byte[])

Source:
HMACSHA1.cs
Source:
HMACSHA1.cs
Source:
HMACSHA1.cs

Computes the HMAC of data using the SHA1 algorithm.

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.

Exceptions

key or source is null.

Applies to

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 6, 7, 8, 9

HashData(ReadOnlySpan<Byte>, Stream)

Source:
HMACSHA1.cs
Source:
HMACSHA1.cs
Source:
HMACSHA1.cs

Computes the HMAC of a stream using the SHA1 algorithm.

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.

Exceptions

source is null.

source does not support reading.

Applies to

.NET 9 og aðrar útgáfur
Vara Útgáfur
.NET 7, 8, 9