Contact Free trial Login

toHex

toHex(Binary): String

Transforms a binary value into a hexadecimal string.

Parameters

Name Description

content

The Binary value to transform.

Example

This example transforms a binary version of "Mule" (defined in the variable, myBinary) to hexadecimal.

Source

%dw 2.0
import * from dw::core::Binaries
output application/json
var myBinary = "Mule" as Binary
var testType = typeOf(myBinary)
---
{
   "binaryToHex" : toHex(myBinary)
}

Output

{ "binaryToHex": "4D756C65" }

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.