From Xojo Documentation

Revision as of 01:07, 30 August 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Returns the MD5 message-digest value of a String. This is the raw data as bytes, so convert it to something such as hexadecimal to display it.



Part Type Description
result String The MD5 message digest form of the passed String.
string String The input string to be parsed.


The MD5 function uses the RSA Data Security, Inc. MD5 Message-Digest Algorithm. The MD5 algorithm is intended for digital signature applications, where a file must be compressed in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA. It is a technology for verifying data integrity and is similar in concept to checksum techniques.

Use the MD5 function to process the raw data to be processed. For complete information on the MD5 message digest format, see RFC 1321.

The MD5Digest class implements the same algorithm but is capable of processing a large file in segments. The MD5 function is better suited for short strings that need to be encrypted such as passwords, account numbers, and private transaction strings.

To compare the MD5 hash from an outside source like PHP often requires that the RB hash be converted to a hex string with EncodeHex for comparison.

Sample Code

Var bytes As String
bytes = MD5("Hello world")

// To display the hash, convert it to hexadecimal
Var hex As String
hex = EncodeHex(bytes)

See Also

MD5Digest class; Crypto.MD5 function