Download the PHP package componenta/byte without Composer
On this page you can find all versions of the php package componenta/byte. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download componenta/byte
More information about componenta/byte
Files in componenta/byte
Download componenta/byte
More information about componenta/byte
Files in componenta/byte
Vendor componenta
Package byte
Short Description Byte, information unit, and bit-rate value objects
License MIT
Package byte
Short Description Byte, information unit, and bit-rate value objects
License MIT
Please rate this library. Is it a good library?
Informations about the package byte
Componenta Byte
Information-size and transfer-rate value objects.
The package contains:
Bytefor data sizes stored internally as bytesByteUnitandInformationUnitenums for unit metadataBitRatefor transfer rates stored internally as bits per secondBitRateUnitfor bit/byte-per-second labels and conversion factors
Installation
Related Packages
This package is standalone.
| Package | Why it may be used nearby |
|---|---|
componenta/duration |
Transfer-time calculations pair naturally with typed durations. |
componenta/validation |
Can validate user input before creating Byte or BitRate. |
componenta/config |
Can store upload or bandwidth limits that are later converted to value objects. |
Byte Usage
Byte accepts numeric values and human-readable strings:
Byte Operations
Byte supports:
- comparison:
compare,equalTo,lessThan,greaterThan, range checks - arithmetic:
increment,decrement,multiply,divide,modulo,abs - aggregation:
sum,average,maximum,minimum - transfer estimates:
getTransferTime,getFormattedTransferTime
Range generation is capped internally to avoid accidental huge allocations.
Bit Rate Usage
BitRate supports both bit and byte transfer units:
Unit Rules
Byteuses binary storage units based on 1024.BitRateuses decimal transfer units based on 1000.BitRatestores its internal value as bits per second.MbpsandMBpsare different labels: megabits per second vs megabytes per second.
Serialization
BitRate implements JsonSerializable. Byte implements Stringable and exposes explicit conversion methods for numeric values and formatted strings.
All versions of byte with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.4
The package componenta/byte contains the following files
Loading the files please wait ...