---
url: >-
  /statelake/scripting-reference/functions-and-procedures/encryption-and-encoding-functions/md5hashhex.md
---

# MD5HashHex

This **MD5HashHex** function returns the MD5 hash of the **Input** string.

Message Digest Algorithm **MD5** is a cryptographic protocol that is used for data encryption, authenticating messages, verifying content, and for digital signatures. The **MD5HashHex** hashing algorithm converts the **Input** string into a hexadecimal encoded string of 32 characters.

As an example, the word “**dinosaur**” will always generate the hash of 03318769a5ee1354f7479acc69755e7c.

If you change just one single bit within the string, the hash output will be completely and irreversibly changed as illustrated in the examples below. And so when you are comparing like for like, nothing less than an exact copy will pass the MD5 test.

**Declaration**: Function MD5HashHex(Input : String): String;

Example

```pascal
procedure OnMapEvent(var Value:Variant);
var
 Str1, Str2, Str3, Str4, Str5 : string;
begin
 //Result will be '03318769a5ee1354f7479acc69755e7c'
  Str1 := MD5HashHex('dinosaur');
 //Result will be 'c965410fafcb123710569d8fd9a72a8b'
  Str2 := MD5HashHex('dinasaur');
 //Result will be '067a4d140ec4b2e9214773579a235613'
  Str3 := MD5HashHex('Cameron');
 //Result will be 'bb36feaac46d7aaab418138b578fd7e0'
  Str5 := MD5HashHex('cameron');
 //Result will be 'c95c95366efdceaf5b1dfc17500a3c10'
  Str5 := MD5HashHex('Patient 5678');

end;
```
