phpinnacle/buffer

PHPinnacle binary buffer implementation

1.2.0 2021-01-03 09:10 UTC

This package is auto-updated.

Last update: 2024-11-29 06:02:17 UTC


README

Latest Version on Packagist Software License Total Downloads

PHPinnacle Buffer is a simple tool for operating binary data in PHP. Mostly it simply wraps PHP pack/unpack functions.

Install

Via Composer

$ composer require phpinnacle/buffer

Basic Usage

<?php

use PHPinnacle\Buffer\ByteBuffer;

// AMQP protocol header
$buffer = new ByteBuffer;
$buffer
    ->append('AMQP')
    ->appendUint8(0)
    ->appendUint8(0)
    ->appendUint8(9)
    ->appendUint8(1)
;

Testing

$ composer test

Benchmarks

$ composer bench

Some results with pure PHP realisation:

And results with enabled extension:

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email dev@phpinnacle.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.