wapmorgan/binary-stream
A PHP library for reading and parsing binary data from streams and files, with convenient typed readers for integers, strings, and custom structures, plus seeking and position tracking for binary file formats.
pack()/unpack(). It lets you decide whether to standardize on hand-rolled pack() format strings (zero dependency, cryptic, easy to get wrong) or a small readable library that names its types (int16, uint32, string, bytes) instead of 'n', 'V', 'a*'.pack('Vsq', ...) calls with a declarative type list reduces the class of bugs that are invisible in review and only surface as corrupt bytes in production.Consider it when:
pack()/unpack() format strings that reviewers can't read.Look elsewhere when:
pack()/unpack() is faster; a wrapper adds object overhead per operation. For bulk decoding in a hot loop, benchmark first.unpack() calls in a single service. The dependency isn't worth the on-call surface.The low opportunity score (26.73) and moderate overall score (0.57) are consistent with this read: useful, well-scoped, effectively unmaintained.
To executives: This is a small, free, MIT-licensed utility that makes binary file and protocol handling in PHP readable and reviewable, replacing error-prone shorthand that silently produces corrupt data. It is not a strategic investment — it's a code-level convenience. The material caveat is provenance: the library has had no release since 2017 and no downstream users, so we should adopt it only as vendored, in-repo code we're prepared to maintain ourselves, not as a supported vendor dependency. Net effect: faster delivery on binary-format features at near-zero licensing cost, with a maintenance obligation we can size at a few hours per PHP upgrade.
To engineering: BinaryStream gives you a declarative type list instead of pack()/unpack() format-character strings, so a reviewer can read a struct definition without a lookup table, and a mis-sized field is visible at the call site. It's small and MIT-licensed. The trade is that it's frozen at a 2017 release — treat it as a starting point, not a dependency: vendor it, add PHP 8 coverage, and benchmark any hot path against native pack() before committing. If the format work grows beyond a handful of call sites, we should re-evaluate against a real codec toolchain rather than extend this.
How can I help you explore Laravel packages today?