PHPackages                             kduma/binary-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kduma/binary-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kduma/binary-tools
==================

PHP library for binary data manipulation and encoding/decoding tools

v0.0.4(9mo ago)1863MITPHPPHP ^8.4CI passing

Since Sep 13Pushed 3mo agoCompare

[ Source](https://github.com/kduma-OSS/PHP-binary-tools)[ Packagist](https://packagist.org/packages/kduma/binary-tools)[ Docs](https://opensource.duma.sh/libraries/php/binary-tools)[ RSS](/packages/kduma-binary-tools/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (4)Versions (6)Used By (3)

Binary Tools
============

[](#binary-tools)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1383123ad6d4ee90c3ccde5e3cba35ced3d9606597deaa3585ff4f5f1a307d2a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b64756d612f62696e6172792d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kduma/binary-tools)[![Tests](https://camo.githubusercontent.com/e5eef459de94ee12c28e447426700337539629ba632ba5e224ac04fb11e49a2d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b64756d612d4f53532f5048502d62696e6172792d746f6f6c732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/kduma-OSS/PHP-binary-tools/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/2c4b67df28036ad356b40acc65859e341cb9685a44303fd9aaf6323de08fa371/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b64756d612f62696e6172792d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kduma/binary-tools)

A PHP library for binary data manipulation and encoding/decoding operations. This library provides safe, efficient tools for working with binary data, including UTF-8 validation and secure string comparisons.

Check full documentation: [opensource.duma.sh/libraries/php/binary-tools](https://opensource.duma.sh/libraries/php/binary-tools)

Installation
------------

[](#installation)

```
composer require kduma/binary-tools
```

Requirements
------------

[](#requirements)

- PHP 8.4+
- `ext-mbstring` - For UTF-8 validation
- `ext-hash` - For secure string comparisons

Features
--------

[](#features)

- **Safe binary data manipulation** with bounds checking
- **UTF-8 string validation** for text data
- **Multiple encoding formats** (hex, base64)
- **Secure string comparison** using `hash_equals()`
- **Big-endian integer support** for network protocols
- **Position tracking** for streaming operations

Core Classes
------------

[](#core-classes)

### BinaryString

[](#binarystring)

Immutable wrapper for binary data with conversion and comparison methods.

### BinaryWriter

[](#binarywriter)

Stream-like writer for building binary data structures.

### BinaryReader

[](#binaryreader)

Stream-like reader for parsing binary data with position tracking.

License
-------

[](#license)

This library is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance70

Regular maintenance activity

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

4

Last Release

288d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d09451622719c7efce1a7971b8e5a875859504882ba2b8c279d1015a99e8f12c?d=identicon)[kduma](/maintainers/kduma)

---

Top Contributors

[![kduma](https://avatars.githubusercontent.com/u/1062582?v=4)](https://github.com/kduma "kduma (41 commits)")

---

Tags

binarylibraryphp

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kduma-binary-tools/health.svg)

```
[![Health](https://phpackages.com/badges/kduma-binary-tools/health.svg)](https://phpackages.com/packages/kduma-binary-tools)
```

###  Alternatives

[ultra-lite/container

2119.4k1](/packages/ultra-lite-container)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
