Skip to content

DFSEC_Decode

Include: Use System\Security.pkg

See Also: Encoding, DFSEC_Encode, DFSEC_DecodeUC

Purpose

Decodes encoded data and returns the decoded value as a DataFlex string.

Syntax

Function DFSEC_Decode Global DFSEC_ENCODING_FORMAT eFormat Variant vValue Returns String

Arguments

eFormat : Encoding format used by the input data. Use one of the C_DFSEC_ENCODING_* constants.

vValue : Encoded data as a DataFlex string or byte-compatible array.

Returns

Decoded data as a String.

Behavior

DFSEC_Decode decodes vValue using eFormat and returns a DataFlex String.

Empty input returns an empty string. An invalid format or unsupported value type raises DFERR_BAD_PARAMETER.

Pass valid encoded data for the selected format. For Hex, provide an even number of hex characters. For Base64 and Base32, include padding when required by the data.

Example

String sEncoded sDecoded

Move "RGF0YUZsZXg=" to sEncoded
Get DFSEC_Decode C_DFSEC_ENCODING_BASE64 sEncoded to sDecoded