DelphiDabbler Wiki



MD5 Message Digest UnitTPJMD5Digest record

Project: MD5 Message Digest Unit

Unit: PJMD5.

Introduced: v1.0

Description

TPJMD5Digest is a record that encapsulates a MD5 digest produced by hashing an octet stream using the MD5 message digest algorithm. These digests are produced by the TPJMD5 class.

The record enables the digest to be cast to and from strings and TBytes byte arrays. It also permits digests to be tested for equality and inequality. In addition the digest data can be accessed either as an array of bytes or as long words.

Fields

TPJMD5Digest is a variant record which provides three different ways of accessing the digest data:

FieldDescription
BytesThis array provides access to each of the 16 bytes of the digest. It is indexed from 0 to 15.
LongWordsThis array provides access the each of the 4 long words that make up the digest. It is indexed from 0 to 3.
A, B, C and DEach of these fields provide an alternate means of accessing the digest data as long words. A, B, C and D are aliases for the elements of the LongWords array at indexes 0, 1, 2 and 3 respectively.

Property

PropertyDescription
PartsDefault array property that provides an alternate means of access the digest as long words. Enables TPJMD5Digest variables to be directly indexed.

Operator Overloads

OperatorDescription
ImplicitEnables TPJMD5Digest records to be cast to and from Unicode strings and TBytes byte arrays.
EqualEnables a TPJMD5Digest record to be compared for equality with another TPJMD5Digest, Unicode strings and TBytes byte arrays.
NotEqualEnables a TPJMD5Digest record to be compared for inequality with another TPJMD5Digest, Unicode strings and TBytes byte arrays.
Page last modified on September 03, 2011, at 10:51 AM