pako 1.0.6

Haxe externs for the pako js library (https://github.com/nodeca/pako)

Released 2017-10-04.

To install, run:

haxelib install pako 1.0.6

See using Haxelib in Haxelib documentation for more information.

MaintainerFuzzyWuzzie
Websitehttps://github.com/FuzzyWuzzie/haxe-pako
Current version1.0.6
StatisticsInstalled 14314 times
LicenseMIT
Tags

README.md

haxe-pako

License

Haxe externs for the pako library.

NOTE: You must import the pako library into your HTML file for this to work. In case the source ever goes offline, a copy can be found here: https://github.com/FuzzyWuzzie/haxe-pako/blob/master/libs/pako.min.js

Examples

Deflating and Inflating an Array

var arr:Array<Int> = new Array<Int>();
for(i in 0...100) {
	arr.push(0);
}
arr[5] = 5;
arr[20] = 20;

var input:Uint8Array = new Uint8Array(arr);
js.Browser.document.write('<p>Input: <pre><code>[' + input + ']</code></pre></p>');

var deflated:Uint8Array = Pako.deflate(input);
js.Browser.document.write('<p>Deflated: <pre><code>[' + deflated + ']</code></pre></p>');

var inflated:Uint8Array = Pako.inflate(deflated);
js.Browser.document.write('<p>Inflated: <pre><code>[' + inflated + ']</code></pre></p>');

Live Sample

A live sample is available which deflates an array of integers and successfully re-inflates them.