Oihana PHP Arango

toHex.php

Table of Contents

Functions

toHex()  : string
Return the hexadecimal representation of a value.

Functions

toHex()

Return the hexadecimal representation of a value.

toHex(string $value) : string

This helper wraps the ArangoDB AQL function TO_HEX(value) which converts the input value to its hexadecimal string representation. This is useful for encoding binary data or converting numbers to hex format.

Example AQL usage:

TO_HEX("hello")               // returns "68656c6c6f"
TO_HEX("world")               // returns "776f726c64"
TO_HEX(doc.data)              // returns hexadecimal representation of data
Parameters
$value : string

String expression to convert to hexadecimal.

Tags
example
use function oihana\arango\db\functions\strings\toHex;

$expr = toHex('doc.data');
// Produces: 'TO_HEX(doc.data)'
see
https://docs.arangodb.com/3.12/aql/functions/string/#to_hex
toBase64()

For Base64 encoding.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results