8ctopus / unsigned-int
Convert signed integers to unsigned
1.0.2
2023-12-28 11:57 UTC
Requires
- php: >=8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- nunomaduro/collision: ^6.2
- phpmd/phpmd: ^2.13
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.5|^10.0
This package is auto-updated.
Last update: 2024-11-26 15:06:20 UTC
README
A php library to convert signed integers to unsigned int.
php does not implement unsigned integers natively which can cause some headaches when unsigned are required. This library hopes to make your life a lot easier.
install and demo
composer require 8ctopus/unsigned-int
use Oct8pus\Unsigned\UInt8; use Oct8pus\Unsigned\UInt16; use Oct8pus\Unsigned\UInt32; require_once './vendor/autoload.php'; echo "convert signed int 8 to unsigned int 8\n"; echo (new UInt8(127)); echo (new UInt8(-128)); $uint8 = new UInt8(); $uint8->toUnsigned(127);
convert signed int 8 to unsigned int 8 127 > 0x7F (127) -128 > 0x80 (128)
tests
composer test
clean code
composer fix(-risky)