Download the PHP package jaredclemence/binn without Composer

On this page you can find all versions of the php package jaredclemence/binn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package binn

binn

A PHP implementation of Binn formatted strings for standard communication of data.

The BINN Specification (visible here) is one of many standardized binary formats for data storage and transfer. It is useful for storing data in a way that can be read by any system, unlike the native PHP serialize method which is only natively readable by PHP itself. Many languages have BINN implementations already, which makes this extremely useful for communicating data-sets between different systems.

The specification linked above hints at using 2's compliment formatting for numbers. More research must be done to learn how dates should be formatted. This readme will be updated with current information as the library grows.

Binary representation is important for encryption and signing. The BINN format provides a deterministic method of ensuring that an object has the same exact binary representation before a cryptographic signature is verified or a hash is generated.

Main interface for working with BinnContainers.

For the most basic interactions and the quickest start, please use the class \JRC\binn\BinnSpecification(). This class provides a simple user interface for encoding BinnObjects and decoding them again.

In this implementation, any "Object" subtypes are always returned as a stdClass implementation with public attributes. All "List" and "Map" types are returned as arrays. Similarly, any array with a string index is written as an Object to conform with the Binn specification. Container types are always written with keys in alphabetical order. This is not part of a standard BinnSpecification, but it ensures that the byte order is always deterministic, which means that the binary output of these processes can be used for encryption and decryption without surprises. (An output can be verified against a signature, for example).

Due to limitations of the PHP language, some defaults have been selected for writing blindly (letting the system auto detect container subtypes). For example, PHP does not handle 64-bit decimals accurately, so this specification defaults to the FLOAT type over DOUBLES. Additionally, \DateTime objects are automatically set to the DATETIME subtype rather than the DATE or the TIME subtypes.

Future implementations will allow you to construct a container using specific subtypes and data.

Reading Binn Data

//1. Load binn data (received from sender or read from file) into a variable
$binnContainerString = "\xE2\x08\x01\x03one\x01"; //BINN data is a binary string

//2. Initialize the main interface 
$binnSpecification = new \JRC\binn\BinnSpecification();

//3. Call the write method.
$nativePHPdata = $binnSpecification->read( $binnContainerString );

//4. use output in code
var_dump( $nativePHPdata->one ); //outputs: true

Writing Binn Data

//1. Put data into a container class (array or object) with public attributes.
$a = new stdClass();
$a->one = 1;
$a->two = 2;
$a->three = new stdClass();
$a->three->cat = "cat";
$a->three->dog = "dog";

//2. Initialize the main interface 
$binnSpecification = new \JRC\binn\BinnSpecification();

//3. Call the write method.
$output = $binnSpecification->write( $a );

//4. Store output or transmit output to a recipient.

All versions of binn with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jaredclemence/binn contains the following files

Loading the files please wait ....