Skip to content
Cloudflare Docs

Encoding functions

bin New

Usage:

bin(<expression>)

bin returns a string containing the binary representation of its argument.

Examples:

-- get the binary representation of 1
bin(1)
-- get the binary representation of a string`
bin('abc')

hex New

Usage:

hex(<expression>)

hex returns a string containing the hexadecimal representation of its argument.

Examples:

-- get the hexadecimal representation of 1
hex(1)
-- get the hexadecimal representation of a string`
hex('abc')