GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - phpinnacle/buffer: Simple library for operating binary data in PHP

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
tests
tests
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 
phpunit.xml
phpunit.xml
 
 

Repository files navigation

PHPinnacle Buffer

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:

Benchmark Best (μs) Mean (μs) Mode (μs) Worst (μs)
appendIntegers 11.605 12.115 12.047 12.888
appendFloats 10.464 10.913 10.786 17.943
appendString 8.857 41.021 20.611 362.174
consume 48.916 50.721 50.399 61.542
read 26.617 27.665 27.500 31.744

And results with enabled extension:

Benchmark Best (μs) Mean (μs) Mode (μs) Worst (μs)
appendIntegers 2.522 2.657 2.625 3.031
appendFloats 1.987 2.136 2.095 3.307
appendString 3.692 3.854 3.806 5.695
consume 13.701 14.654 14.454 17.977
read 5.128 5.425 5.313 6.625

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

  • PHPinnacle
  • All Contributors

License

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

About

Simple library for operating binary data in PHP

Topics

binarybinary-databytebufferbytesphpphp-libraryphp7phpinnacle

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

24 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.