2017 © Pedro Peláez
 

library numco

NUMber COmpressor - small library for numeric arrays compression.

image

inelo/numco

NUMber COmpressor - small library for numeric arrays compression.

  • Wednesday, April 12, 2017
  • by inelo
  • Repository
  • 0 Watchers
  • 0 Stars
  • 386 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 60 % Grown

The README.md

NUMCO - NUMber COmpressor

A small compression/decompression library for numerical arrays. Its best suited for large data sets of integers., (*1)

How it works

Internally this lib creates a delta encoded array and then deflates it using zlib., (*2)

Delta encoding is one of the most powerfull numeric compression methods out there. Its a simple algorithm that converts values in given array so that each represents a difference from the previous value., (*3)

Delta encoding example:, (*4)

[100, 101, 102, 103, 104, 105] converts to [100, 1, 1, 1, 1, 1]

Charts

(the more sequential data the better compression ratio), (*5)

charts, (*6)

Mini DOC

Compression, (*7)

Numco::compress(array) : string
    expects array of numbers as argument and returns compressed base64 encoded string

Decompression, (*8)

Numco::decompress(string) : array
    expects compressed base64 encoded string and returns decompressed array of numbers

Composer Installation

$ composer require inelo/numco

Example usage

use Inelo\Numco\Numco;

$numArray = [ 100, 101, 102, ... ];

$compressed = Numco::compress($numArray);
$decompressed = Numco::decompress($compressed);

echo "compressed base64 encoded string : " . $compressed . "\n";
echo "decompressed array : " . var_export($decompressed, true) . "\n";

Running tests

vendor/bin/phpunit tests, (*9)

Release History

  • 1.0.0 Initial release

The Versions

12/04 2017

dev-master

9999999-dev

NUMber COmpressor - small library for numeric arrays compression.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Marek Mazur

numco

12/04 2017

1.0.0

1.0.0.0

NUMber COmpressor - small library for numeric arrays compression.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Marek Mazur

numco