Skip to content

Latest commit

 

History

History
90 lines (47 loc) · 1.77 KB

README.md

File metadata and controls

90 lines (47 loc) · 1.77 KB

heatshrink Extension for PHP

This extension allows heatshrink compression/decompression in PHP.

Heatshrink is data compression/decompression library for embedded/real-time systems » https://github.com/atomicobject/heatshrink.

Build

% phpize
% ./configure
% make
% make install

Configration

hs.ini:

extension=hs.so

Function

  • hs_compress — heatshrink compression
  • hs_decompress — heatshrink decompression

hs_compress — heatshrink compression

Description

string hs_compress ( string $data [ , int $window = 8 , int $lookahead = 4 ] )

heatshrink compression. You must use same window and lookahead values for compression/decompression.

Pameters

  • data

    The string to compress.

  • window

    2^n size of window

  • lookahead

    2^n size of lookahead

Return Values

Returns the compressed data or FALSE if an error occurred.

hs_decompress — heatshrink decompression

Description

string hs_decompress ( string $data [ , int $window = 8 , int $lookahead = 4 ] )

heatshrink decompression. You must use same window and lookahead values for compression/decompression.

Pameters

  • data

    The string to compress.

  • window

    2^n size of window

  • lookahead

    2^n size of lookahead

Return Values

Returns the decompressed data or FALSE if an error occurred.

Examples

$compressed_data = hs_compress('test');

$data = hs_decompress($compressed_data);

Authors

Alex Stanev [email protected], Plamen Baruh [email protected], 2014

heatshrink by Scott Vokes

extension code based on » https://github.com/kjdev/php-ext-lz4