PHPackages                             aliance/bitmask - 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. aliance/bitmask

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

aliance/bitmask
===============

Simple bitmask implementation

4.0.0(2w ago)6154.2k↓51.1%1MITPHPCI passing

Since Nov 10Pushed 2w agoCompare

[ Source](https://github.com/Aliance/Bitmask)[ Packagist](https://packagist.org/packages/aliance/bitmask)[ Docs](https://github.com/Aliance/Bitmask)[ RSS](/packages/aliance-bitmask/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (1)

Simple bitmask implementation
=============================

[](#simple-bitmask-implementation)

[![License](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)[![Packagist](https://camo.githubusercontent.com/a225787053e534548141ed5ffb57712c3d365a1f44d7e4cfa025241261442756/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c69616e63652f6269746d61736b2e737667)](https://packagist.org/packages/aliance/bitmask)[![PHP Version](https://camo.githubusercontent.com/5ce5eca50a57098a749fbc385bde2fe8fda7e1b2cccb4c982b3a220e117d68e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332d677265656e2e737667)](https://camo.githubusercontent.com/5ce5eca50a57098a749fbc385bde2fe8fda7e1b2cccb4c982b3a220e117d68e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332d677265656e2e737667)[![Code Coverage](https://camo.githubusercontent.com/6874b45a28c613b0a379e52a162d403ea2a2c9a638a7de5b08349ab4b5285502/68747470733a2f2f636f6465636f762e696f2f67682f416c69616e63652f4269746d61736b2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Aliance/Bitmask)

About
-----

[](#about)

Bitmask is a simple PHP implementation of bitwise operations for creating masks. Can be used for some flags' implementation. Supports only 64 bits (from 0 to 63) on x64 platforms.

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

[](#installation)

Install the latest version with composer:

```
composer require aliance/bitmask
```

If you checkout this library for testing purposes, install its dependencies:

```
docker run --rm -it --volume $PWD:/app -u $(id -u):$(id -g) composer:2 i
```

Usage
-----

[](#usage)

See usage in [sample](./example/example.php) file.

```
docker run -it --rm -v "$PWD":/usr/src/bitmask -w /usr/src/bitmask php:8.3-cli php example/example.php
```

```
Check user for all access levels:
Create: no
Read: no
Update: no
Delete: no
–––––––––––––––––––––––––––––––––––

Check user for all access levels:
Create: no
Read: yes
Update: no
Delete: no
–––––––––––––––––––––––––––––––––––

```

Tests
-----

[](#tests)

For completely tests running just call `composer exec phpunit` or use

```
docker run -it --rm -v "$PWD":/usr/src/bitmask -w /usr/src/bitmask php:8.3-cli php ./vendor/bin/phpunit
```

License
-------

[](#license)

This software is distributed under [MIT license](LICENSE).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance96

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~292 days

Recently: every ~823 days

Total

13

Last Release

19d ago

Major Versions

1.1.1 → 2.0.0-rc12017-06-08

2.0.1 → 3.0.02023-02-03

3.0.0 → 4.0.02026-06-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b57839ecac7c4cf4918480b8f468c2444ca451ca583510df39b112789c41132?d=identicon)[Aliance](/maintainers/Aliance)

![](https://www.gravatar.com/avatar/6ce9ca0af2d4086bace90d0233ecf09c52130fdd9456d3b5c6f99089fb19f812?d=identicon)[trilobit](/maintainers/trilobit)

---

Top Contributors

[![Aliance](https://avatars.githubusercontent.com/u/7838144?v=4)](https://github.com/Aliance "Aliance (30 commits)")[![trilobit](https://avatars.githubusercontent.com/u/1970047?v=4)](https://github.com/trilobit "trilobit (2 commits)")

---

Tags

bitmaskbitsbitwisebitwise-operatorsbitmask

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aliance-bitmask/health.svg)

```
[![Health](https://phpackages.com/badges/aliance-bitmask/health.svg)](https://phpackages.com/packages/aliance-bitmask)
```

###  Alternatives

[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k78.3k90](/packages/pocketmine-pocketmine-mp)[godruoyi/php-snowflake

An ID Generator for PHP based on Snowflake Algorithm (Twitter announced).

8652.6M68](/packages/godruoyi-php-snowflake)[pocketmine/raklib

A RakNet server implementation written in PHP

101595.3k17](/packages/pocketmine-raklib)[pocketmine/binaryutils

Classes and methods for conveniently handling binary data

26729.9k42](/packages/pocketmine-binaryutils)[yaroslavche/bitmask

BitMask, EnumBitMask

3458.4k1](/packages/yaroslavche-bitmask)[furqansiddiqui/ethereum-php

A modern, dependency-light Ethereum library powered by a clean cryptographic core

1825.7k1](/packages/furqansiddiqui-ethereum-php)

PHPackages © 2026

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