A package for converting data.
$ composer require pxgamer/convert
Convert from a string to bytes
use pxgamer\Convert\Bytes; // Metric standard format Bytes::toInt('1B'); // IEC standard format Bytes::toInt('1GiB');
Convert from bytes to a human-readable string
use pxgamer\Convert\Bytes; // This is always formatted as metric in the output Bytes::toString(1000);
Please see CHANGELOG for more information on what has changed recently.
$ composer test
If you discover any security related issues, please email firstname.lastname@example.org instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.