Varint stream processor

Maintainers

👁 ciaranmcnulty

Package info

github.com/ciaranmcnulty/varint

pkg:composer/ciaranmcnulty/varint

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 5

Open Issues: 0

dev-master 2021-03-07 17:51 UTC

Requires

  • php: ^7.2 || ~8.0.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 2792b6ef1b80d75d72486cd49dc7dd83c77fced3

  • Ciaran McNulty <mail.woop@ciaranmcnulty.com>

This package is auto-updated.

Last update: 2026-06-08 05:47:00 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
}