Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for a 128 bit type #2180

Closed
awalterschulze opened this issue Sep 25, 2016 · 9 comments
Closed

Proposal for a 128 bit type #2180

awalterschulze opened this issue Sep 25, 2016 · 9 comments

Comments

@awalterschulze
Copy link

These days people communicating uuids and ipv6 addresses between processes is quite common. These can both be addressed with a 128 bit type.

Just to give an idea of how many users already want this and hack around this.
I have protobuf code generator for go (gogoprotobuf) and I have added a feature called customtype. This allows you to change a bytes type to a type of your choice, but still transfer it as bytes. This allows for quite a large variety of applications, but what people use it for is very constraint. Most users just want some 128bit type.

@acozzette
Copy link
Member

Transferring this type as bytes (i.e. with the length-delimited wire type) sounds like a good idea. That way we would have the option of implementing it first just for one or two languages, and other languages without support for it could at least handle the data gracefully (e.g. by treating it as an unknown field or just a bytes field). I wonder what the API would look like since as far as I know most languages don't have a standard 128-bit type--maybe just the raw array of 16 bytes?

@awalterschulze
Copy link
Author

perfect :)

@pascaldekloe
Copy link

For Go you can do this nicely with a [16]byte into the struct so no extra malloc. Same goes for C when you expose the length as a constant.
How would one do that for Java? Two (signed) long? :-( Just a byte array couses marshalling errors on size mismatch. A generated class with fields byte0 to byte15?

@awalterschulze
Copy link
Author

awalterschulze commented Dec 12, 2017

@gerben-s @jtattermusch why is this closed?

@mbautin
Copy link

mbautin commented Mar 16, 2018

+1 to this feature request -- we could make a good use of it in YugaByte DB as well, for UUIDs, IPv6 addresses, MVCC timestamps, etc.

@loyd
Copy link

loyd commented Mar 30, 2019

Any progress?

@pascaldekloe
Copy link

I'm trying to get this one right at pascaldekloe/colfer#36. Feedback wanted.

@dzmitry-lahoda
Copy link

dzmitry-lahoda commented Jul 8, 2022

u128 is pervasive in blockchains. bytes is not good as cannot 7bit compress small amounts of assets which usually start from trillions.

@pascaldekloe
Copy link

The need is clear. No need for more use-cases here please. Same with the status requests. Unless you have something to contribute, this feature is pending on some serious work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants