hex_binary()

Scalar. Converts a hex string into a binary type.

Syntax

hex_binary ( string )

Parameters

string

A hex string, with or without the preceding "0x" or "0X".

Usage

Takes a hex string, and converts it into a binary type. Valid characters for a hex string are a-f, A-F, and 0-9. The string must contain an even number of characters. The function takes a string as its argument, and the function returns a binary value.

Example

hex_binary ('0xAA1B223F') returns AA1B223F.

hex_binary ('0xaa') returns AA.