See https://developers.google.com/protocol-buffers/docs/overview#assigning_field_numbers
Basically: - positive integers - unique within each message (can reuse between different messages) - lower is cheaper - avoid some reserved ranges On Tue, 30 Jun 2020, 20:12 rohit nv, <[email protected]> wrote: > > I am new to the gRPC and Protobuf. Wanted to know the significance of > encoding > number infront of field. In tutorial I saw about the usage of no between > 1-15 for frequently used fields as it require 1 byte of encoding and 16 to > remaining carries 2 bytes of encoding. May I know when to to use what. > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/protobuf/78789856-f4cf-444b-a7a7-14ff3f260595n%40googlegroups.com > <https://groups.google.com/d/msgid/protobuf/78789856-f4cf-444b-a7a7-14ff3f260595n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CAF95VAyi_3djk0irmdL2qnVpg1j4z2FVLBKR2kQPDsptgQOrmQ%40mail.gmail.com.
