Compressing JSON with HPack algorithm

Hi friends,
Today I going to discuss about compressing  JSON data HPack Algorithm.
JSON.hpack is a lossless, cross language, performances focused, data set compressor. It is able to reduce up to 70% number of characters used to represent a generic homogeneous collection. This algorithms provides several level of compression (from 0 to 4). The level 0 compression performs the most basic compression by removing keys (property names) from the structure creating a header on index 0 with each property name. Next levels make it possible to reduce even more the size of the JSON by assuming that there are duplicated entries.
For the following JSON
[ { “name”:”Andrea”, “age”:31, “gender”:”Male”, “skilled”:true }, { “name”:”Eva”, “age”:27, “gender”:”Female”, “skilled”:true }, { “name”:”Daniele”, “age”:26, “gender”:”Male”, “skilled”:false } ]
the hpack algorithm produces a compressed version which looks like this:
About JSON.hpack for PHP
Rather than a class or a public object, the PHP version respects its language nature, adding 4 functions in the global scope:
json_hpack, json_hunpack, json_hbest, and a “private use only” json_hunpack_createRow.
Please note that current PHP version works only with database fetched objects, rather than associative arrays.
For More detail please use .
Cheers 🙂

Share This Post

Recent Articles

Leave a Reply


© 2019 Networkocean. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by WordPress · Designed by Theme Junkie