This extension allows heatshrink compression/decompression in PHP.
Heatshrink is data compression/decompression library for embedded/real-time systems » https://github.com/atomicobject/heatshrink.
% phpize
% ./configure
% make
% make install
hs.ini:
extension=hs.so
- hs_compress — heatshrink compression
- hs_decompress — heatshrink decompression
string hs_compress ( string $data [ , int $window = 8 , int $lookahead = 4 ] )
heatshrink compression. You must use same window and lookahead values for compression/decompression.
-
data
The string to compress.
-
window
2^n size of window
-
lookahead
2^n size of lookahead
Returns the compressed data or FALSE if an error occurred.
string hs_decompress ( string $data [ , int $window = 8 , int $lookahead = 4 ] )
heatshrink decompression. You must use same window and lookahead values for compression/decompression.
-
data
The string to compress.
-
window
2^n size of window
-
lookahead
2^n size of lookahead
Returns the decompressed data or FALSE if an error occurred.
$compressed_data = hs_compress('test');
$data = hs_decompress($compressed_data);
Alex Stanev alex@stanev.org, Plamen Baruh plamen_baruch@yahoo.com, 2014
heatshrink by Scott Vokes
extension code based on » https://github.com/kjdev/php-ext-lz4