ftos.convert.byteArray.toHex
Encodes binary data into its hexadecimal string representation.
IMPORTANT!
The input binary data must be provided via an object implementing the IFtosWorkflowBlob interface. This interface doesn't expose the underlying bytes directly. Instead, you must populate the object via a method such as ftos.convert.base64.toByteArray.
The input binary data must be provided via an object implementing the IFtosWorkflowBlob interface. This interface doesn't expose the underlying bytes directly. Instead, you must populate the object via a method such as ftos.convert.base64.toByteArray.
Syntax
Copy
ftos.convert.byteArray.toHex(blob: IFtosWorkflowBlob): string;
| Parameter | Type | Description |
|---|---|---|
blob
|
IFtosWorkflowBlob | Container storing the binary data to encode. |
Return Value
A string containing the hexadecimal representation of the data. Each byte is represented by two uppercase hexadecimal characters (digits 0–9 and letters A–F).
Interfaces
IFtosWorkflowBlob
A binary data container exposing only the byte length of the data through a read-only length property, without providing direct access to the underlying bytes.
Copy
interface IFtosWorkflowBlob {
readonly length: number;
}
| Property | Type | Description |
|---|---|---|
length
|
number | Number of bytes of the binary data. |
Example
This example:
- Takes the SGVsbG8gV29ybGQ= Base64 string, which encodes the text Hello World.
- Decodes it into binary data using the ftos.convert.base64.toByteArray method.
- Encodes the binary data to hexadecimal notation 48656C6C6F20576F726C64.
- Stores the result in the hexData variable.
Copy
var hexData = ftos.convert.byteArray.toHex(ftos.convert.base64.toByteArray('SGVsbG8gV29ybGQ='));