(4 Kb)
Updated: 09/03/17 10:19 PM
File Info
Horns of the Reach (3.1)
Morrowind (3.0)
Homestead (2.7)
Updated:09/03/17 10:19 PM
Created:03/19/17 11:40 PM
Monthly downloads:63
Total downloads:374
Version: 1.03
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.


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.


lua Code:
  1. LBE:decode(base256,<optional> tableFlag)

The "base256" must be a string or number (not recommended). If "tableFlag" is true then the returned data will be in a table otherwise it will be a string.

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

lua Code:
  1. LBE:IsTrue(boolean,<optional> strict) OR IsTrue(boolean,<optional> strict)

IsTrue will take a value and determine if it is true. Unlike Lua's default, it evaluates 0 and empty strings as false. If strict is true, only the most basic forms of boolean "true" will be considered true. For example: 5 or "content" would evaluate as false.

lua Code:
  1. LBE:NumBool(boolean,<optional> strict) OR NumBool(boolean,<optional> strict)

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.

lua Code:
  1. LBE:SplitString(inputString,<optional> separator)

LBE:SplitString will take an input string and break it down character by character into a table. If "separator" is used it will be the preferred method of breaking the string, but defaults to "%s". This splitter does not consume any characters unless specified by separator.

How to Include
Warning: Spoiler
Version 1.03
*Changed string 0 to evaluate false.
*Added strict flag to IsTrue and NumBool.
*Added choice flag for decoding to a string or table.
*Added specialized string splitter.

Version 1.02 - API bump
Version 1.01 - API bump
Optional Files (0)

Archived Files (3)
File Name
07/15/17 06:05 PM
05/22/17 01:40 PM
03/20/17 12:15 AM

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

Forum posts: 305
File comments: 423
Uploads: 15
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's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 43
Uploads: 7
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: