Category: Libraries
Addon Information
Download Latest Version.
To add favorites please register for a free account. If you already have one you need to login. How do I install this? (FAQ)
Brodrick's Portal Bug Reports Feature Requests
Author:
Version:
1.0
Date:
10-01-2006 11:04 PM
Size:
4.00 Kb
Downloads:
518
Favorites:
2
MD5:
lzwLib-1.0
A simple lua LZW compression library.

----

Syntax:

lzw:compress("string"[,chatsafe][,CompressTable,TableSize]);
returns compressed string

lzw:decompress("string"[,chatsafe][,CompressTable,TableSize]);
returns decompressed string

----

Typical usage:

----

local compressed = lzw:compress("Some text or arbitrary data in a string");
local decompressed = lzw:decompress(compressed);

----

Optimal compression can be achieved by creating code tables for specific input sets. For example:

----

local DecompressTable = {};
local CompressTable = {};
local TableSize;

lzw:begin_analyze();

for all input strings...
lzw:analyze_string( Str );
...

TableSize = lzw:end_analyze(DecompressTable, CompressTable);

local compressed = lzw:compress("Some data to compress", nil, CompressTable, TableSize);
local decompressed = lzw:decompress(compressed, nil, DecompressTable, TableSize);

----

Note that the decompression table and table size must be stored to be able to decompress data at a later point in time.

----

The resulting compressed string can optionally be output in a chat safe format.

----

local compressed = lzw:compress( Str, true );
local decompressed = lzw:decompress( Str, true );

----

Note that a string that has been compressed using the chat safe flag must be decompressed with the flag or the decompressed
string may become garbled.
  Optional Files - lzwLib-1.0
Sorry, there are currently no optional files available.
  Comments - lzwLib-1.0
Post A Reply Comment Options
Old 02-08-2007, 01:12 PM  
Tokter
A Kobold Labourer
Interface Author - Click to view interfaces

Forum posts: 1
File comments: 1
Uploads: 1
Found a bug and a few changes that are necessary:

Line 118:
for k, v in var do -> for k, v in pairs(var) do

Line 285:
Input = string.gsub(Input, specialpercent, percent); -> Input = string.gsub(Input, specialpercent, percentpercent);

Line 413:
for k, v in self.AnalyzeCharacters do -> for k, v in pairs(self.AnalyzeCharacters) do

Line 418:
for k, v in OutReverseTable do -> for k, v in pairs(OutReverseTable) do
Tokter is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 10-02-2006, 12:31 PM  
Brodrick
A Fallenroot Satyr
Interface Author - Click to view interfaces

Forum posts: 25
File comments: 14
Uploads: 15
Quote:
Originally posted by kaylen
The US LZW patents expired a couple years ago, it should be fine now. I can't speak for other countries, though.
The fact the patents had expired was a major reason why lzw was used.
__________________
- Brodrick (aka Kirov)
Brodrick is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 10-02-2006, 10:09 AM  
kaylen
A Murloc Raider
Interface Author - Click to view interfaces

Forum posts: 6
File comments: 40
Uploads: 2
The US LZW patents expired a couple years ago, it should be fine now. I can't speak for other countries, though.
kaylen is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 10-02-2006, 08:09 AM  
Miravlix
A Defias Bandit
 
Miravlix's Avatar
Interface Author - Click to view interfaces

Forum posts: 2
File comments: 1
Uploads: 5
Unhappy Lzw Patent

http://en.wikipedia.org/wiki/LZW#Patent_issues

Great work making lzw for Bliz Lua, but unfortuanately it's a cesspool of patent crap.
Miravlix is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Post A Reply



Category Jump:




The Network:
EQInterface | EQ2Interface | LoTROInterface | MMOInterface | War.MMOUI | WoWInterface | VGInterface | Allakhazam | Thottbot | Wowhead | Zam


©2009 MMOUI / ZAM Network
vBulletin - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.