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
Requires
- php: ^8.4
- ext-bcmath: *
- psr/simple-cache: ^3.0
- thesis/endian: ^0.3.0
- thesis/time-span: ^0.2.3
- thesis/varint: ^0.2.0
Requires (Dev)
- ext-filter: *
- phpunit/phpunit: ^12.4.4
- symfony/var-dumper: ^6.4.15 || ^7.3.5
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