MD5Stream

Cryptography

Description

Computes the MD5 digest of an entire stream, reading from the start regardless of the entry position

The digest comes back as 16 raw binary bytes packed into an AnsiString, one digest byte per character; on Windows the hashing runs through CryptoAPI in 8000-byte chunks, on FPC through the bundled MD5 core

Syntax

Delphi

Function MD5Stream(Input: TStream): AnsiString;

Parameters

InputStream to hash; the position is seeked to 0 first

Return value

The raw 16-byte digest, or an empty/short string when the platform path fails; MD5File checks Length >= 16 before trusting it

Remarks

Unlike the SHA-2 stream helpers this function hashes the whole stream and offers no byte-range parameters

See also

MD5File, MD5String, SHA256StreamRange, SHA512StreamRange