MD5 Message Digest Unit 1.1

By Peter Johnson

Freeware 24 Jan 2013

In category

Components > Miscellaneous > Other

Description

This unit contains an implementation of the MD5 message digest algorithm. A Delphi class named TPJMD5 provides overloaded methods for calculating the MD5 of

  • Files.
  • Byte arrays.
  • Strings: Unicode, ANSI and short strings are all supported.
  • Streams.
  • Untyped data buffers (useful for getting the MD5 of ordinal values).

Data types can be mixed and matched. Class methods provide quick shortcuts to taking the MD5 of a single file or single data item without having to create and free a TPJMD5 instance.

There is also an "advanced" record, TPJMD5Digest, that encapsulutes a MD5 digest. Operator overloads for assigning digests to and from strings and bytes arrays are provided. The digest can also be read in long words chunks.

The code was developed from scratch based on the algorithm presented in RFC 1321. Portions of the code are translated from the reference C code supplied in the RFC. However the code is not a literal translation into Pascal from the reference C code.

The algorithm and reference code are copyright © 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.

DUnit tests for the unit are supplied in the download. The tests include all those specified in RFC 1321 (http://www.faqs.org/rfcs/rfc1321.html).

The unit is fully documented at http://www.delphidabbler.com/url/md5-docs

Informations

  • Status: Fully functional
  • Source: FW
  • Size: 109 310kB

Platforms:

  • Delphi 2009
  • Delphi 2010
  • Delphi XE
  • Delphi XE 2
  • Delphi XE3
  • Delphi XE2 64-bit

Downloads