ciaranmcnulty / varint
Varint stream processor
dev-master
2021-03-07 17:51 UTC
Requires
- php: ^7.2 || ~8.0.0
Requires (Dev)
- phpunit/phpunit: ^8.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-08 06:21:13 UTC
README
Varint streams can be used to delimit binary messages without expending the stream size significantly. They are especially useful for message formats without inherent delimiting (e.g. protobuf).
Usage
Decoding a stream as strings
use Cjm\Varint\Stream\Decoder;
$decoder = Decoder::fromPath('php://stdin');
foreach($decoder->strings() as $string) {
// do something with the message
}