Introduction:
CBOR is a binary format that can represent arbitrarily nested data.
The principle is basically the same as with JSON.
There you can take your variables directly from the program and convert them to this format.
This way you can store your data outside the program or exchange it with other programs, which is even easier since almost all programming languages understand the JSON standard.
CBOR is quite similar, but the difference is that CBOR is not a text-based format, but a binary format.
This of course makes it impossible for a human to read it directly but on the other hand the results are usually smaller than in JSON.
How to use?:
Now how to work with it? - Here is an example:
In this case our AutoIt data structure occupies 29 bytes of space at the end.
Since the comparison to JSON is obvious - here is another example (the JSON UDF is also needed) to see how both interact:
>>sourcecode and download on github<<
Changelog:
2023-02-08: fixed bug when encoding big integer numbers