thesis/protobuf

A modern strictly typed full-featured serializer for Google's protocol buffers.

Fund package maintenance!
www.tinkoff.ru/cf/5MqZQas2dk7

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/thesis/protobuf

0.1.x-dev 2025-12-18 15:52 UTC

This package is auto-updated.

Last update: 2025-12-18 18:13:16 UTC


README

Installation

composer require thesis/protobuf

Serialize protobuf message

use Thesis\Protobuf;

$message = Protobuf\message(
    Protobuf\fieldOf(1, Protobuf\stringOf('kafkiansky')),
    Protobuf\fieldOf(2, Protobuf\stringT->list(['thesis', 'typhoon'])),
);

$serializer = new Protobuf\Serializer();

$buffer = $serializer->serialize($message);

echo bin2hex($buffer);

Deserialize protobuf message

use Thesis\Protobuf;

$messageT = Protobuf\messageT(
    Protobuf\fieldT(1, Protobuf\stringT),
    Protobuf\fieldT(2, Protobuf\listT(Protobuf\stringT)),
);

// TODO