ftos.convert.string.toByteArray

Decodes a string using a specified character encoding and returns an object conforming to the IFtosWorkflowBlob interface, which exposes the byte length of the decoded binary data. This is useful for determining the size of the decoded content without exposing the raw bytes or as input for other methods such as ftos.convert.byteArray.toHex.

NOTE  
The returned object does not provide direct access to the underlying byte array. However, internally, the string must be decoded into a byte array as an intermediate step to determine the byte length of the binary data.

Syntax

Copy
ftos.convert.string.toByteArray(input: string, encoding: "utf7" | "utf8" | "utf32" | "unicode" | "ascii"): IFtosWorkflowBlob
 
Parameter Type Description
input string Input string to decode.
encoding string Character encoding used to interpret the input string. Possible values:
  • utf8
  • unicode
  • utf7
  • ascii
  • utf32

Return Value

Returns an IFtosWorkflowBlob object.

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.

Encoding and Byte Length Variations

The byte length depends on both the encoding and the actual characters in the input:

Examples