BinaryDecode()
Converts a string to a binary object.
Used to convert binary data that has been encoded into string format back into binary data.
BinaryDecode( encoded_binary=string, binaryEncoding=string, precise=boolean );
Returns: binary
| Argument | Description | Default |
|---|---|---|
|
encoded_binary
string,
required
|
edit
A string containing encoded binary data. Alias: encodedBinary, string, value |
|
|
binaryEncoding
string,
required
|
edit
A string specifying the algorithm used to encode the original binary data into a string; must be one of the following:
Alias: encoding |
|
|
precise
boolean,
optional
|
edit
if set to true the input must follow the rule for that encoding a 100%, the decryptor will not try to interpret inputs that are not a 100% correct. This should be used to avoid false positives. Introduced: 6.0.0.227 |
true |
Examples
editbase_64 = ToBase64("I am a string.");
binary_data = ToBinary(base_64);
encoded_binary = BinaryEncode(binary_data, "hex");
dump(BinaryDecode(encoded_binary, "hex"));
See also
- Binary data
- BinaryEncode()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)