Class

# MD5Digest

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Processes a `String</api/data_types/string>` and returns the message-digest form of the input string.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                     | Type                             | Read-Only | Shared |
|--------------------------|----------------------------------|-----------|--------|
| `Value<md5digest.value>` | `String</api/data_types/string>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                         | Parameters                               | Returns | Shared |
|------------------------------|------------------------------------------|---------|--------|
| `Clear<md5digest.clear>`     |                                          |         |        |
| `Process<md5digest.process>` | Data As `String</api/data_types/string>` |         |        |

## Property descriptions

<div id="md5digest.value">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MD5Digest.Value

**Value** As `String</api/data_types/string>`

> Contains the current message digest as raw bytes.
>
> ``` xojo
> Var m As New MD5Digest
> Var s As String
>
> m.Process("Hello world")
> s = m.Value
> ```

## Method descriptions

<div id="md5digest.clear">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MD5Digest.Clear

**Clear**

> Resets the <span class="title-ref">MD5Digest</span> object so that you can start with a new data stream.
>
> The following example calls Clear after the <span class="title-ref">MD5Digest</span> instance processes a string.
>
> ``` xojo
> 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
> ```

<div id="md5digest.process">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MD5Digest.Process

**Process**(Data As `String</api/data_types/string>`)

> *Data* is the text to be processed.
>
> This code uses Process to input the data to the MDsDigest instance:
>
> ``` xojo
> Var m As New MD5Digest
> Var s As String
>
> m.Process("Hello world")
> s = m.Value
> ```

## Notes

The <span class="title-ref">MD5Digest</span> class uses the RSA Data Security, Inc. MD5 Message-Digest Algorithm. The <span class="title-ref">MD5Digest</span> 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 <span class="title-ref">MD5Digest</span> 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

``` xojo
Var m As New MD5Digest
Var s As String

m.Process("Hello world")
s = m.Value
```

## Compatibility

|                       |                               |
|-----------------------|-------------------------------|
| **Project Types**     | Console, Desktop, Mobile, Web |
| **Operating Systems** | iOS, Linux, macOS, Windows    |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `MD5</api/cryptography/md5>` function.

</div>
