Class
MD5Digest
Description
Processes a String and returns the message-digest form of the input string.
Property descriptions
MD5Digest.Value
Value As String
Contains the current message digest as raw bytes.
Var m As New MD5Digest
Var s As String
m.Process("Hello world")
s = m.Value
Method descriptions
MD5Digest.Clear
Clear
Resets the MD5Digest object so that you can start with a new data stream.
The following example calls Clear after the MD5Digest instance processes a string.
Var m As New MD5Digest
Var s As String
m.Process("Hello world")
s = m.Value
Label1.Text = s
m.Clear
m.Process("Hello world?")
s = m.value
Label2.Text = s
MD5Digest.Process
Process(Data As String)
Data is the text to be processed.
This code uses Process to input the data to the MDsDigest instance:
Var m As New MD5Digest
Var s As String
m.Process("Hello world")
s = m.Value
Notes
The MD5Digest class uses the RSA Data Security, Inc. MD5 Message-Digest Algorithm. The MD5Digest class enables you to process a string in segments. Pass each string segment to the Process method. The Value property contains the current message digest and the Clear method clears the MD5Digest object so that you can repeat the process.
The MD5 message digest algorithm takes a message of any length and produces a 128-bit "fingerprint" or message digest of the input string. The MD5 algorithm is useful for digital signature applications, where a large file must be processed in a secure manner before being encrypted with a secret key under a system such as RSA. See RFC 1321 for complete information.
Compatibility Note: An MD5 hash created using php (i.e. from the web) returns a hex string. To compare an MD5 hash from an outside source to a Xojo-created MD5 hash requires that the Xojo-created hash be converted to a hex string for comparison.
Sample code
Var m As New MD5Digest
Var s As String
m.Process("Hello world")
s = m.Value
Compatibility
All project types on all supported operating systems.