Skip to content

DFSEC_EncodeEx

Include: Use System\Security.pkg

See Also: Encoding, DFSEC_DecodeEx

Purpose

Encodes a byte range addressed by a pointer and returns encoded text.

Syntax

Function DFSEC_EncodeEx Global DFSEC_ENCODING_FORMAT eFormat Pointer pValue ULongptr ulSize Returns String

Arguments

eFormat : Encoding format. Use one of the C_DFSEC_ENCODING_* constants.

pValue : Pointer to the first byte to encode.

ulSize : Number of bytes to read starting at pValue.

Returns

Encoded text as String.

Behavior

DFSEC_EncodeEx operates on exactly ulSize bytes starting at pValue and returns the result as String.

Invalid format, null or empty pointer, or zero or empty size raises DFERR_BAD_PARAMETER.

Advanced: pointer input

Use DFSEC_EncodeEx only when the source data already exists in addressable memory. Otherwise prefer the regular String and UChar[] APIs.

Example

String sValue sResult
Pointer pValue

Move "DataFlex" to sValue
Move (AddressOf(sValue)) to pValue
Get DFSEC_EncodeEx C_DFSEC_ENCODING_BASE64 pValue (SizeOfString(sValue)) to sResult