1.2.0 • Published 1 year ago

huffy v1.2.0

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Huffy

A tiny compression library based on Huffman coding.

Install

npm install --save huffy

Usage

import {compress, decompress} from 'huffy';

const str = 'some string to compress, it works better with longer things'.repeat ( 10 );
const buffer = new TextEncoder ().encode ( str );

const compressed = compress ( buffer );
const decompressed = decompress ( compressed );

console.log ( 'Compression ratio:', compressed.length / buffer.length );

License

MIT © Fabio Spampinato

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago