SHA512 Class

Namespace: System.Security.Cryptography

Assembly: System.Core.dll

Provides an implementation of the SHA512 hash algorithm.

Inheritance

System.Object

Remarks

The SHA512 hash algorithm is a cryptographic hash function that produces a 512-bit (64-byte) hash value. This hash value is typically used to detect integrity of data. When data is hashed, the resulting hash value is usually unique. A small change to the data will, with a high probability, produce a different hash value.

SHA512 is part of the SHA-2 family of hash functions developed by the U.S. National Security Agency.

This class is a managed implementation of the SHA512 algorithm. For improved performance, consider using the cryptographic APIs provided by the operating system.

Methods

ComputeHash

static Byte[] ComputeHash(Byte[] buffer)

Computes the SHA512 hash value for the specified region of the input byte array.

ComputeHash

static Byte[] ComputeHash(Byte[] buffer, Int32 offset, Int32 count)

Computes the SHA512 hash value for the specified region of the input byte array.

ComputeHash

static Byte[] ComputeHash(Stream inputStream)

Computes the SHA512 hash value for the specified stream.

Create

static SHA512 Create()

Creates an instance of the default implementation of the SHA512 hash algorithm.

Create

static SHA512 Create(String hashName)

Creates an instance of the specified implementation of the SHA512 hash algorithm.

HashData

static Byte[] HashData(ReadOnlySpan{Byte} data)

Computes the SHA512 hash value for the specified data.

HashData

static Byte[] HashData(ReadOnlySpan{Byte} data, HashAlgorithmName hashAlgorithm)

Computes the SHA512 hash value for the specified data.

HashData

static Byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm)

Computes the SHA512 hash value for the specified stream.

Properties

HashSize

override Int32 HashSize { get; }

Gets the size, in bits, of the computed hash code.

Hash

virtual Byte[] Hash { get; }

Gets the hash value.

InputBlockSize

override Int32 InputBlockSize { get; }

Gets the input block size.

OutputBlockSize

override Int32 OutputBlockSize { get; }

Gets the output block size.

See Also