SHA256ByteArray

Cryptography

Description

Computes the SHA-256 digest of a byte array and returns it as a fixed-size TPLSHA256Digest value of 32 raw bytes

The hash is produced by the built-in TDCP_sha256 implementation contained in the digest unit, so no CryptoAPI provider is required; an empty array returns the digest of the empty message

Syntax

Delphi

Function SHA256ByteArray(Input: Array Of Byte): TPLSHA256Digest;

Return values

The SHA-256 digest as a TPLSHA256Digest array of 32 raw binary bytes, not hexadecimal text

Remarks

TPLSHA256Digest is declared as Array [0..31] of Byte; the input is hashed in a single update call starting at Input[0], and SHA384ByteArray plus SHA512ByteArray follow the same pattern with wider digest arrays

Example

Digest:= SHA256ByteArray(Data);

See also

SHA384ByteArray, SHA512ByteArray, SHA3_256ByteArray, SHA3_384ByteArray, SHA3_512ByteArray, SHA1StreamRange, SHA256StreamRange, SHA384StreamRange, SHA512StreamRange, SHA3_256StreamRange, SHA3_384StreamRange, SHA3_512StreamRange, SHAKE256ByteArray, SHAKE256StreamRange