Today we will talk about how to compress natural numbers, in other words, those that are not negative. You can use these functions to compact ages, sequences, telephones, internal codes, documents that only have numbers.
Well, to facilitate our learning, open polidatacompressor.com in Google Chrome and right-click choose the last menu option that should be “Inspect” or if you prefer use the shortcut CTRL + SHIFT + I.
A window like the image below will appear.
If you are not in the “Console” option, navigate through the options until you find it.
Compacting natural numbers
To compress natural integers we must use the NCOMP (Numeric Compressor) command, see how simple it is to compact the number 65535.
The result is two bytes represented by 255, 255.
So if your DAPP or SMART CONTRACT were to store FIVE positions in Blockchain, it would only spend TWO.
Decompressing natural numbers
To decompress natural integers you must use the NDECOMP command (Numeric DECOMPressor).
For us, the command used would be NDECOMP ([255, 255]), see:
Caution: The maximum limit of the compression function NCOMP is a sequence of fifteen numeric characters.
How to deploy the library in your web application
To deploy just download the .ZIP file on the site itself, unzip and reference the files in the <HEAD> of your HTML page.
You must to reference the JQuery library too.
About the license
Don’t worry about the license if your application stay in testing; but if this give to you opportunity to save money, you should contact us and negotiate a license for use.
Thanks for reading