Compress Storage by jCtapuk

TEMPLATE NAME: Compress Storage
CORE VERSION: 1.10.3
TEMPLATE VERSION: 0.1.0

TEMPLATE DESCRIPTION:
Automatically load and save compressed data based on Base64 compressed string. And convenient API functions for extension.
A full description is in the Readme as well as an example Example

QUESTIONS:

  1. How does this system work?
    Based on binary operations allows you to write and read string data at the level of behavior binary binary so it's all already implemented under the hood of the component.

  2. You could not show an example of Writer and Reader?
    If you have a 6 key per 1 bit, the system will pack in 1 character per store. This is suitable for boolean 6 values per 1 bit because the dictionary consists of 64 characters per 6 bits.

local writer = Base64.Writer()
writer.write(1, 0)
writer.write(1, 0)
writer.write(1, 1)
writer.write(1, 1)
writer.write(1, 1)
writer.write(1, 0)
print(writer.raw()) -- return 1 symbol
local reader = Base64.Reader(<input data string>)
for i = 1, 6 do
  print(reader.read(1)) -- return number 0-1
end

TEMPLATE ROADMAP:

  • Add a scheme to keep the old and new version compatible
  • Add reference numbers to duplicates to further optimize and compress
  • Implement Base64 serialization table and put it into storage

TEMPLATE VERSION NOTES:
0.1.0 - Initial release

MEDIA:

1 Like