comely-io/buffer-php

Arbitrary bytes buffer in PHP

0.1.17 2023-03-19 01:26 UTC

This package is auto-updated.

Last update: 2024-10-19 05:13:37 UTC


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.

Methods