TPLSHA256Digest
Cryptography, digital signatures
Description
TPLSHA256Digest is a fixed array[0..31] of Byte that carries a 32-byte digest by value. SHA256ByteArray and SHA3_256ByteArray return it, and callers pass it between helpers that compare fingerprints, build signed attributes or write audit evidence.
Element 0 is the first and most significant byte as the hash emits it, so a hexadecimal rendering walks the array from low to high index. Because the width is fixed, the type can sit directly in a record field or method parameter without allocating, which is why internal structures such as content fingerprints use it instead of TBytes.
Syntax
Delphi
TPLSHA256Digest = Array [0.. 31] Of Byte;Remarks
The type name states the size, not the algorithm: the SHA-3 selector returns the same 32 bytes through the same type.
The stream-range form SHA256StreamRange hashes the two signed ranges of a PDF revision and returns the same bytes as an AnsiString, which is how the signing path computes the digest it embeds.
The *Raw helpers return the identical bytes as an AnsiString, which suits DER and stream code but carries no length guarantee at compile time.
No text form is built in. Rendering each byte yourself, for example LowerCase(IntToHex(Digest[I], 2)), produces the usual lowercase hexadecimal fingerprint.
To place the digest in a binary field, allocate 32 bytes and Move from element 0; the content hashing stream does exactly that in its Finish method.
The array is a value type: assignment copies all 32 bytes, and comparing two digests needs CompareMem or a byte loop because = is not defined for arrays.