---
title: "Converting a md5 hash value to hex"
slug: "converting-a-md5-hash-value-to-hex"
updated: 2023-01-06T15:49:51Z
published: 2023-01-06T15:49:51Z
canonical: "docs.catchpoint.com/converting-a-md5-hash-value-to-hex"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.catchpoint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Converting a md5 hash value to hex

## Overview

The API monitor supports the hash macro which can apply a specified hash algorithm to a given string. The default method used for hashing is **md5**.

Our md5 hashing algorithm differs from that of PHP. PHP's `md5()` function by default returns the hex variation of the hash, whereas the md5 hash algorithm in Catchpoint doesn't convert to hex by default. To convert the md5 hash value to hex, use the method below.

## Example:

```
open(https://www.google.com)
var foo = ${Hash(md5, q5ptx7hvqf8n35mqny98rzr8frDyWstZGc1476226186)}
var bar = ${hex(${var(foo)})}
open(https://www.google.com/?q=${var(bar)})
```

---

In the above example, first we apply md5 hash algorithm to the string `q5ptx7hvqf8n35mqny98rzr8frDyWstZGc1476226186` and the returned value is stored in variable named "foo". Later, we apply hex macro to convert the returned string from hash algorithm and the new hex value is stored in variable named "bar".
