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
This package is auto-updated.
Last update: 2024-12-08 02:25:55 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
}