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

3.0.0(3y ago)6142.6k↓32.5%[1 PRs](https://github.com/Aliance/Bitmask/pulls)1MITPHPCI passing

Since Nov 10Pushed 3mo 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 1mo ago

READMEChangelog (10)Dependencies (2)Versions (14)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/fce1492cd36b86256ad3768aca02bd7b73d7275452eb215fb3101ecf098825d6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312d677265656e2e737667)](https://camo.githubusercontent.com/fce1492cd36b86256ad3768aca02bd7b73d7275452eb215fb3101ecf098825d6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312d677265656e2e737667)[![Code Coverage](https://camo.githubusercontent.com/12cdcce1ff60e0048aa75668a06225e0d8905a3adef70c8cefaf6a568ef4c5b8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f416c69616e63652f4269746d61736b2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Aliance/Bitmask/?branch=master)

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.1-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.1-cli php ./vendor/bin/phpunit
```

License
-------

[](#license)

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

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance53

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 93.5% 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 ~207 days

Recently: every ~516 days

Total

12

Last Release

1201d ago

Major Versions

1.1.1 → 2.0.0-rc12017-06-08

2.0.1 → 3.0.02023-02-03

### 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 (29 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.5k74.6k86](/packages/pocketmine-pocketmine-mp)[godruoyi/php-snowflake

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

8582.3M61](/packages/godruoyi-php-snowflake)[bitwasp/bitcoin

PHP Bitcoin library with functions for transactions, signatures, serialization, Random/Deterministic ECDSA keys, blocks, RPC bindings

1.1k533.2k43](/packages/bitwasp-bitcoin)[bitwasp/buffertools

Toolbox for working with binary and hex data. Similar to NodeJS Buffer.

65764.4k41](/packages/bitwasp-buffertools)[pocketmine/math

PHP library containing math related code used in PocketMine-MP

45573.2k14](/packages/pocketmine-math)[pocketmine/nbt

PHP library for working with Named Binary Tags

42574.4k13](/packages/pocketmine-nbt)

PHPackages © 2026

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