Quantcast
Download
(4 Kb)
Download
Updated: 03/20/17 12:15 AM
Pictures
File Info
Compatibility:
Homestead (2.7)
Updated:03/20/17 12:15 AM
Created:03/19/17 11:40 PM
Monthly downloads:46
Total downloads:69
Favorites:0
MD5:
2.7
LibBinaryEncode
Version: 1.0
by: Rhyono [More]
This library was designed for compressing large amounts of binary data into small spaces. For example, research and recipe knowledge sharing would benefit from this.

It uses a custom base-256 encoding, specially tailored to ESO's character set support. I've tested it extensively, but encoding is messy business, so only time will tell if there are any issues.

How to Use
The main functionality of course is to compress binary data into a data string that can be entered into text fields in ESO.

Encoding

lua Code:
  1. LBE:encode(binary)

The "binary" can be a number (not recommended), a string or a table of boolean values. It will handle the conversion from the table, so you do not need to worry about whether it is a numeric or boolean binary value.

Decoding

lua Code:
  1. LBE:decode(base256)

The "base256" must be a string or number (not recommended). I may implement table support later if there's a valid reason to do so.

Helpers
These are functions that you don't necessarily need but I found useful:

lua Code:
  1. LBE:IsTrue(boolean) OR IsTrue(boolean)

IsTrue will take a value and determine if it is true. Unlike Lua's default, it evaluates 0 and empty strings as false.

lua Code:
  1. LBE:NumBool(boolean) OR NumBool(boolean)

NumBool will take a value (assumed boolean) and return 0 or 1. When combined with doing your boolean checks using IsTrue, it allows saving booleans as a single byte instead of multiple in savedvars, which adds up for addons using a lot of booleans.

How to Include
Warning: Spoiler
Optional Files (0)


Post A Reply Comment Options
Unread 03/21/17, 09:17 AM  
Rhyono
AddOn Author - Click to view AddOns

Forum posts: 172
File comments: 158
Uploads: 12
That looks like a byte per boolean, right? This is designed for purely boolean data and as such compresses it to a bit per boolean. I don't believe MessagePack could fit everything into a guild note (254 character).
Report comment to moderator  
Reply With Quote
Unread 03/21/17, 12:49 AM  
Architecture
 
Architecture's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 31
Uploads: 6
What is the advantage of this over using a popular implementation such as MessagePack? http://msgpack.org/index.html http://fperrad.github.io/lua-MessagePack/ -- in theory this should be able to just run since it is purely Lua (or Lua-like) implementation without any extra dependencies. The downside is we can't really benefit from choosing our own JIT such as LuaJIT.

Cool idea -- good work!
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: