Discussion:
[protobuf] Proto3 Storing UUID
Osman Ali
2016-04-29 05:39:13 UTC
Permalink
Looking use a 128 bit uuid according to rfc4122. For Proto3 should use
bytes type?

So:

message SendIdentifier {
bytes user_uuid = 1;
}
--
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 protobuf+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
'Adam Cozzette' via Protocol Buffers
2016-05-06 22:48:17 UTC
Permalink
The bytes type sounds like a good choice to me. I could also imagine using
a pair of fixed64 fields if you want to avoid having to validate the length
of the byte string.
Post by Osman Ali
Looking use a 128 bit uuid according to rfc4122. For Proto3 should use
bytes type?
message SendIdentifier {
bytes user_uuid = 1;
}
--
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
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
--
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 protobuf+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Walter Schulze
2016-05-07 12:49:59 UTC
Permalink
I wish there was just a 128 bit type, that could be used for uuid and ipv6,
but for now we are stuck with the choice between bytes and two fixed64s,
and the two groups of people that disagree about which is better.
Post by 'Adam Cozzette' via Protocol Buffers
The bytes type sounds like a good choice to me. I could also imagine using
a pair of fixed64 fields if you want to avoid having to validate the length
of the byte string.
Post by Osman Ali
Looking use a 128 bit uuid according to rfc4122. For Proto3 should use
bytes type?
message SendIdentifier {
bytes user_uuid = 1;
}
--
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
<javascript:>.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
--
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 protobuf+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
t***@appcelerator.io
2017-01-11 22:35:00 UTC
Permalink
Late answer, but I would have recommended string. Keeps it human readable
and also, I suppose, not have to be concerned with endian order.
Post by Osman Ali
Looking use a 128 bit uuid according to rfc4122. For Proto3 should use
bytes type?
message SendIdentifier {
bytes user_uuid = 1;
}
--
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 protobuf+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
'Bo Yang' via Protocol Buffers
2017-01-11 23:06:40 UTC
Permalink
I recommend bytes field. If you use string, it won't accept non-utf8
character.
Post by t***@appcelerator.io
Late answer, but I would have recommended string. Keeps it human readable
and also, I suppose, not have to be concerned with endian order.
Looking use a 128 bit uuid according to rfc4122. For Proto3 should use
bytes type?
message SendIdentifier {
bytes user_uuid = 1;
}
--
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
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
--
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 protobuf+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Loading...