alcamo / binary-data
Simple classes the model binary data, in particular BCD
Installs: 117
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/alcamo/binary-data
Requires
- php: 7.3 - 8.0
- alcamo/string: ^0.6
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: 3.*
README
Class BinaryString
Represents binary content, providing implicit conversion to
hexadecimal string, count()
(returning the number of bytes) and []
operations (accessing a single byte as its integer value).
Provides a number methods to convert from and to binary content and a number of common operations such as trimming on either side, as well as bitwise AND and OR operations.
Class HexString
Represents an uppercase hexadecimal string, potentially with an odd number of characters.
Class EvenHexString
Represents an uppercase hexadecimal string with an even number of characters.
Class Bcd
Represents BCD-encoded data.
Provides methods to convert from and to integers.
Class CompressedBcd
Represents compressed numeric data as defined in the EMV specification.
The difference between Bcd
and CompressedBcd
is that in the
former, data is right-justified and may be padded with 0
nibbles on
the left, while in the latter, datav is left-justified and may be
padded with F
nibbles on the right.