Download the PHP package guillaumetissier/bit-string without Composer
On this page you can find all versions of the php package guillaumetissier/bit-string. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package bit-string
BitString
A PHP library for manipulating bit strings with both mutable and immutable implementations.
Features
- Two implementations: Mutable (
BitString) and Immutable (BitStringImmutable) - Flexible conversion system: Pluggable converters for different formats
- Bitwise operations: AND, OR, XOR, NOT, shifts, rotations
- Type-safe: Full type hints and strict typing
- Well-tested: Comprehensive test suite
Installation
Usage
Creating BitStrings
Using Converters
Mutable vs Immutable
Bitwise Operations
Bit Manipulation
Shifts and Rotations
Extraction
All extraction methods return the same type as the source (BitString or BitStringImmutable), and work identically on both implementations.
When to Use Mutable vs Immutable
Use BitString (mutable) when:
- You need to modify bits in loops (better performance)
- Working with large bit strings that change frequently
- Building bit strings incrementally
- Performance is critical
Use BitStringImmutable when:
- Thread safety is important
- You want to avoid side effects
- Working with functional programming patterns
- The bit string represents a value that shouldn't change
Requirements
- PHP 8.1 or higher
Testing
License
MIT License
All versions of bit-string with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
ext-ctype Version *
ext-ctype Version *
The package guillaumetissier/bit-string contains the following files
Loading the files please wait ...