comely-io / buffer-php
Arbitrary bytes buffer in PHP
Installs: 9 266
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- ext-gmp: *
README
Buffer for PHP strings (ByteArray)
Prerequisites
- PHP 8.0+
- GMP extension enabled
Installation
composer require comely-io/buffer-php
Buffer
Constructors
Fixed-length Buffers
Methods
Writeable Buffers
All the methods from fixed-length buffers above, and also:
Methods
ByteReader
For systematically reading bytes from buffer in order. Useful for serialization and un-serialization of data (i.e. Bitcoin blocks and transactions)
Methods
ByteDigest
Applies hash function to bytes in buffer and returns digest bytes.
Check PHP.net hash_algos() and hash_hmac_algos() for list of available/supported algorithms.