bitwasp / buffertools
Toolbox for working with binary and hex data. Similar to NodeJS Buffer.
Installs: 684 127
Dependents: 40
Suggesters: 0
Security: 0
Stars: 64
Watchers: 6
Forks: 27
Open Issues: 6
Requires
- php-64bit: >=7.0.0
Requires (Dev)
- phpunit/phpunit: ^6.0
- squizlabs/php_codesniffer: ~2.0
- dev-master
- 0.5.x-dev
- v0.5.7
- v0.5.6
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- 0.4.x-dev
- v0.4.7
- v0.4.6
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- 0.3.x-dev
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3
- v0.2.1
- v0.2
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- v0.0.4
- 0.0.3
- v0.0.2
- v0.0.1
- v0.0.0
This package is auto-updated.
Last update: 2024-11-12 23:48:49 UTC
README
This library provides a Buffer
and Parser
class to make dealing with binary data in PHP easier.
Templates
extend this by offering a read/write interface for larger serialized structures.
Requirements:
- PHP 7.0+
- Composer
- ext-gmp
Installation
You can install this library via Composer: composer require bitwasp/buffertools
Examples
Buffer's are immutable classes to store binary data. Buffer::hex can be used to initialize from hex Buffer::int can be used to initialize from a positive decimal integer (int|string)
Buffer's main methods are:
- getBinary()
- getHex()
- getInt()
Parser will read Buffers. Parser's main methods are:
- readBytes()
- writeBytes()
- readArray()
- writeArray()
In most cases, the interface offered by Parser should not be used directly. Instead, Templates expose read/write access to larger serialized structures.