Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions data/en/decryptbinary.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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
}
]
}
12 changes: 10 additions & 2 deletions data/en/deserialize.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name":"deserialize",
"type":"function",
"syntax":"deserialize(string, type, useCustomSerializer);",
"returns":"string",
"returns":"any",
"related":["serialize"],
"description":"Deserializes a string.",
"params": [
Expand All @@ -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
}
]
}
12 changes: 10 additions & 2 deletions data/en/encryptbinary.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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
}
]
}
10 changes: 9 additions & 1 deletion data/en/paragraphformat.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. <P>\r\nThis is a new paragraph. <P>",
"runnable":true
}
]

}
12 changes: 10 additions & 2 deletions data/en/tobinary.json
Original file line number Diff line number Diff line change
Expand Up @@ -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":[]}
Expand All @@ -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
}
]

}
10 changes: 9 additions & 1 deletion data/en/xmlchildpos.json
Original file line number Diff line number Diff line change
Expand Up @@ -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( \"<list><item>A</item><note>X</note><item>B</item></list>\" );\r\nwriteOutput( xmlChildPos( doc.list, \"item\", 2 ) );",
"result":"3",
"runnable":true
}
]

}
Loading