Skip to content

Latest commit

Β 

History

History
67 lines (50 loc) Β· 1.7 KB

File metadata and controls

67 lines (50 loc) Β· 1.7 KB

Simple bitmask implementation

License Packagist PHP Version Code Coverage

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

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

See usage in sample 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

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

This software is distributed under MIT license.