• Stars
    star
    149
  • Rank 248,619 (Top 5 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 12 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LZ4 Extension for PHP

LZ4 Extension for PHP

Linux Windows

This extension allows LZ4.

Documentation for LZ4 can be found at ยป https://github.com/Cyan4973/lz4.

Build from sources

% git clone --recursive --depth=1 https://github.com/kjdev/php-ext-lz4.git
% cd php-ext-lz4
% phpize
% ./configure
% make
% make install

To use the system library

% ./configure --with-lz4-includedir=/usr

Distribution binary packages

Fedora / CentOS / RHEL

RPM packages of this extension are available in ยป Remi's RPM repository and are named php-lz4.

Debian

DEB packages of this extension are available in ยป Ondล™ej Surรฝ's DEB repository and are named php-lz4.

Configuration

php.ini:

extension=lz4.so

Function

  • lz4_compress โ€” LZ4 compression
  • lz4_uncompress โ€” LZ4 decompression

lz4_compress โ€” LZ4 compression

Description

string lz4_compress ( string $data [ , int $level = 0 , string $extra = NULL ] )

LZ4 compression.

Pameters

  • data

    The string to compress.

  • level

    The level of compression (1-12, Recommended values are between 4 and 9). (Default to 0, Not High Compression Mode.)

  • extra

    Prefix to compressed data.

Return Values

Returns the compressed data or FALSE if an error occurred.

lz4_uncompress โ€” LZ4 decompression

Description

string lz4_uncompress ( string $data [ , long $maxsize = -1 , long $offset = -1 ] )

LZ4 decompression.

Pameters

  • data

    The compressed string.

  • maxsize

    Allocate size output data.

  • offset

    Offset to decompressed data.

Return Values

Returns the decompressed data or FALSE if an error occurred.

Examples

$data = lz4_compress('test');

lz4_uncompress($data);

Compress Data

Default

$data = lz4_compress('test')

compress-default

Extra prefix data

$data = lz4_compress('test', false, 'PREFIX')

compress-extra

Uncompress Data

Default

lz4_uncompress($data);

uncompress-default

Offset

lz4_uncompress($data, 256, 6);

uncompress-offset

More Repositories

1

php-ext-zstd

Zstd Extension for PHP
C
204
star
2

php-ext-brotli

Brotli Extension for PHP
C
171
star
3

php-ext-snappy

Snappy Extension for PHP
PHP
127
star
4

apache-mod-brotli

mod_brotli is Brotli compression module for Apache HTTPD Server.
C
61
star
5

php-ext-handlersocketi

PHP HandlerSocket plugin for MySQL Improved Extension
C
44
star
6

php-ext-jq

This extension allows jq
PHP
41
star
7

php-redis-graph

RedisGraph PHP Client
PHP
40
star
8

php-ext-unqlite

UnQLite Extension for PHP
C
34
star
9

hoextdown

Hoextdown is an extension to Hoedown
C
23
star
10

nginx-auth-jwt

Nginx module for the authenticate using JWT
C
20
star
11

nginx-keyval

Nginx module for the key-value store
Perl
19
star
12

php-ext-hoedown

PHP Extension for Hoedown
PHP
16
star
13

php-ext-zopfli

This extension allows Zopfli compression.
PHP
16
star
14

apache-mod-sass

mod_sass is Sass handler module for Apache HTTPD Server.
C
10
star
15

php-ext-vedis

PHP Extension for Vedis
C
6
star
16

php-ext-msgpacki

PHP MessagePack Improved Extension
PHP
6
star
17

php-ext-sophia

PHP Extension for Sophia
C
6
star
18

apache-mod-fluentd

Apache fluentd module
C
6
star
19

php-password-hashing

PHP Password Hashing Command
C
5
star
20

phpman

PHP manual for command line
Shell
5
star
21

zmq-tools

ZeroMQ tools
C++
5
star
22

php-ext-elog

elog function Extension for PHP
C
5
star
23

php-ext-override

Override function Extension for PHP
C
5
star
24

php-ext-wiredtiger

C
5
star
25

php-ext-extension_load

PHP Extension load library
C
4
star
26

apache-mod-kafka

Kafka data collector module for Apache HTTPD Server
C
4
star
27

php-ext-callmap

Call a callback with an map of parameters function Extension for PHP
PHP
4
star
28

apache-mod-sundown

mod_sundown is Markdown handler module for Apache HTTPD Server.
C
4
star
29

zlmb

ZeroMQ-based Log Message broker
C
3
star
30

apache-mod-v8

mod_v8 is Javascript V8 Engine handler module for Apache HTTPD Server.
C++
3
star
31

php-ext-shellinford

PHP Extension for shellinford (FM-Index)
C
3
star
32

apache-mod-hoedown

mod_hoedown is Markdown handler module for Apache HTTPD Server
C
3
star
33

apache-mod-shorturl

mod_shorturl is mongoDB base shorturl module for Apache HTTPD Server.
C++
2
star
34

nginx-thumbhash

Nginx module for the ThumbHash
C
2
star
35

php-ext-xz

XZ Extension for PHP
PHP
2
star
36

php-ext-tink

Tink for PHP
C++
2
star
37

php-ext-transactd

PHP Extension for Transactd Plugin
C++
2
star
38

php-ext-enum

Enum interface
C
2
star
39

livereload-c

An implementation of the LiveReload server in C (libwebsocket)
C
2
star
40

nginx-jq

C
2
star
41

php-ext-bzip3

Bzip3 Extension for PHP
C
2
star
42

php-ext-extmethod

PHP extension is Extension method by closure.
PHP
1
star
43

nginx-qoi

C
1
star
44

fswatch

fswatch of notifytools use version.
C
1
star
45

php-ext-hidefl

Hidef lite function Extension for PHP
C
1
star
46

apache-mod-coffee

mod_coffee is CoffeeScript handler module for Apache HTTPD Server.
C
1
star
47

jq-api

API system with JSON files and jq filters
Shell
1
star
48

php-ext-brunsli

Brunsli Extension for PHP
C
1
star
49

mariadb-udf-php-password-hashing

PHP Password Hashing for MariaDB/MySQL UDF
C
1
star
50

woothee-c

The C implementation of Project Woothee
C
1
star