# llMD5String

*LSL function*

```lsl
string string llMD5String(string src, integer nonce);
```

- `string src`: Source string to hash.
- `integer nonce`: Nonce string used as a salt.

- Returns: `string`
- Energy: 10

Returns a string of 32 hex characters representing the MD5 checksum of src salted with nonce (formatted as ':' + nonce).

Returns a [string](https://wiki.secondlife.com/wiki/string) of 32 hex characters that is the [MD5](https://en.wikipedia.org/wiki/MD5) checksum of **src** with a [salt](https://en.wikipedia.org/wiki/salt_%28cryptography%29) of `":"+nonce`.

```lsl title="How to use" frame="terminal"
string result = llMD5String("", 0);
```

## Specification

**nonce** is casted to string, then appended to **src** after a colon (`src + ":" + nonce`). This is important to know if you are calculating a hash in another language and wish to compare with one calculated in LSL. It could be written as `MD5Hash(src + ":" + nonce)`

The character encoding used by `llMD5String` is the UTF-8 format.

## Examples

<details open>
<summary>Example 1</summary>

```lsl
llSay(0, llMD5String("Hello, Avatar!", 0)); // returns 112abd47ceaae1c05a826828650434a6
```

</details>

<details>
<summary>Example 2</summary>

#### Linux Example

```lsl
$ echo -n 'Hello, Avatar!:0' | openssl md5
112abd47ceaae1c05a826828650434a6
```

</details>

## See also

### Functions

- [llSHA1String](/functions/llSHA1String/)
- [llSHA256String](/functions/llSHA256String/)

---

*Source: [LlMD5String](https://wiki.secondlife.com/wiki/LlMD5String) on the Second Life Wiki. Content from the Second Life Wiki articles LlMD5String (revision 1211958, 2022-09-16) and Template:LSL Function/warning (revision 1168838, 2012-06-11), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llMD5String/
