Skip to content
generated from thesis-php/template

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

License

Notifications You must be signed in to change notification settings

thesis-php/protobuf

Repository files navigation

Thesis Protobuf

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published