diff --git a/data/en/decryptbinary.json b/data/en/decryptbinary.json index 2e3406b82..0a1ab6f72 100644 --- a/data/en/decryptbinary.json +++ b/data/en/decryptbinary.json @@ -2,7 +2,7 @@ "name":"decryptBinary", "type":"function", "syntax":"decryptBinary(binaryData, key [, algorithm [, encoding] [, iv | salt [, iterations]]])", - "returns":"string", + "returns":"binary", "related":["encryptBinary","decrypt","encrypt"], "description":"Decrypts encrypted binary data with the specified key, value, algorithm, salt, and iterations.", "params": [ @@ -22,5 +22,13 @@ "boxlang": {"minimum_version":"1.0.0", "notes":"", "docs":"https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/encryption/decrypt"} }, "links": [], - "examples":[] + "examples":[ + { + "title":"Decrypt AES encrypted binary data", + "description":"Decrypts binary data that was encrypted with encryptBinary, using the same key and algorithm.", + "code":"key = generateSecretKey( \"AES\" );\r\ndata = charsetDecode( \"Hello World\", \"utf-8\" );\r\nencrypted = encryptBinary( data, key, \"AES\" );\r\ndecrypted = decryptBinary( encrypted, key, \"AES\" );\r\nwriteOutput( charsetEncode( decrypted, \"utf-8\" ) );", + "result":"Hello World", + "runnable":true + } + ] } diff --git a/data/en/deserialize.json b/data/en/deserialize.json index b780b3d2d..f51f932f9 100644 --- a/data/en/deserialize.json +++ b/data/en/deserialize.json @@ -2,7 +2,7 @@ "name":"deserialize", "type":"function", "syntax":"deserialize(string, type, useCustomSerializer);", - "returns":"string", + "returns":"any", "related":["serialize"], "description":"Deserializes a string.", "params": [ @@ -14,5 +14,13 @@ "coldfusion": {"minimum_version":"11", "notes":"", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/deserialize.html"} }, "links": [], - "examples": [] + "examples": [ + { + "title":"Deserialize a JSON string into a struct", + "description":"Converts a JSON string back into CFML data using ColdFusion's default JSON deserializer.", + "code":"person = deserialize( '{\"firstName\":\"John\",\"lastName\":\"Doe\"}', \"json\", false );\r\nwriteOutput( person.firstName & \" \" & person.lastName );", + "result":"John Doe", + "runnable":true + } + ] } diff --git a/data/en/encryptbinary.json b/data/en/encryptbinary.json index edb337623..b75da07cc 100644 --- a/data/en/encryptbinary.json +++ b/data/en/encryptbinary.json @@ -2,7 +2,7 @@ "name":"encryptBinary", "type":"function", "syntax":"encryptBinary(binaryData, key [, algorithm [, encoding] [, iv | salt [, iterations]]])", - "returns":"string", + "returns":"binary", "related":["decryptBinary", "generateSecretKey"], "description":"Encrypts binary data using a specific algorithm and encoding method.", "params": [ @@ -21,5 +21,13 @@ "boxlang": {"minimum_version":"1.0.0", "notes":"", "docs":"https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/encryption/encrypt"} }, "links": [], - "examples":[] + "examples":[ + { + "title":"Encrypt and decrypt binary data with AES", + "description":"Encrypts binary data with a generated AES key and decrypts it again with the same key.", + "code":"key = generateSecretKey( \"AES\" );\r\ndata = charsetDecode( \"Hello World\", \"utf-8\" );\r\nencrypted = encryptBinary( data, key, \"AES\" );\r\ndecrypted = decryptBinary( encrypted, key, \"AES\" );\r\nwriteOutput( charsetEncode( decrypted, \"utf-8\" ) );", + "result":"Hello World", + "runnable":true + } + ] } diff --git a/data/en/paragraphformat.json b/data/en/paragraphformat.json index 1cd99ca6b..ea8c4357c 100644 --- a/data/en/paragraphformat.json +++ b/data/en/paragraphformat.json @@ -17,6 +17,14 @@ }, "links": [ + ], + "examples": [ + { + "title":"Convert line breaks into HTML paragraphs", + "description":"A single line break becomes a space, a double line break starts a new paragraph.", + "code":"text = \"This sentence\" & chr(10) & \"continues here.\" & chr(10) & chr(10) & \"This is a new paragraph.\";\r\nwriteOutput( paragraphFormat( text ) );", + "result":"This sentence continues here.
\r\nThis is a new paragraph.
",
+ "runnable":true
+ }
]
-
}
diff --git a/data/en/tobinary.json b/data/en/tobinary.json
index b5f7b3b59..bdf231479 100644
--- a/data/en/tobinary.json
+++ b/data/en/tobinary.json
@@ -3,7 +3,7 @@
"type":"function",
"syntax":"toBinary(base64_or_object)",
"returns":"binary",
- "related":[],
+ "related":["toBase64","toString"],
"description":" Calculates the binary representation of Base64-encoded data.",
"params": [
{"name":"base64_or_object","description":"A string or a variable that contains one:\n * In Base64 format to convert to binary\n * In binary format to test whether it is valid","required":true,"default":"","type":"any","values":[]}
@@ -17,6 +17,14 @@
},
"links": [
+ ],
+ "examples": [
+ {
+ "title":"Convert a Base64 string to binary",
+ "description":"Decodes a Base64-encoded string into binary data and converts it back to a readable string.",
+ "code":"bin = toBinary( \"SGVsbG8gV29ybGQ=\" );\r\nwriteOutput( toString( bin ) );",
+ "result":"Hello World",
+ "runnable":true
+ }
]
-
}
diff --git a/data/en/xmlchildpos.json b/data/en/xmlchildpos.json
index 92ddf6e03..de978c6b4 100644
--- a/data/en/xmlchildpos.json
+++ b/data/en/xmlchildpos.json
@@ -19,6 +19,14 @@
},
"links": [
+ ],
+ "examples": [
+ {
+ "title":"Find the position of the second item element",
+ "description":"The second item element is the third child of list, because a note element comes before it.",
+ "code":"doc = xmlParse( \"
\" );\r\nwriteOutput( xmlChildPos( doc.list, \"item\", 2 ) );",
+ "result":"3",
+ "runnable":true
+ }
]
-
}