Skip to content

This extension allows heatshrink compression/decompression in PHP

License

Notifications You must be signed in to change notification settings

RealEnder/php-ext-hs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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

About

This extension allows heatshrink compression/decompression in PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published