Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Javadoc for machine id max is not accurate #11

Open
yaseenkadir opened this issue Jun 16, 2019 · 0 comments
Open

Javadoc for machine id max is not accurate #11

yaseenkadir opened this issue Jun 16, 2019 · 0 comments

Comments

@yaseenkadir
Copy link

Machine id javadoc says it's in the range of 0-262143.

* Unsigned 16 bits integer value (0-262143) is required.

* Machine ID is expected as a 16-bits unsigned integer value (0-262143), and identifies {@link Camflake} instance.

2^16 is 65536. So the javadoc is incorrect here.

Given that the bit format only supports 16 bits for the machine id perhaps it would make more sense to change it to short? That way 16 bits is enforced. And since DefaultMachineId uses the last two octets of the machine local address it will always fit. However that may require changing the API of MachineId and other users may have created alternative implementations so changing to a short may break it for them.

I'm aware this is a super minor issue and I'm raising this as an FYI. I'm thankful for this library and appreciate the work the engineers have done to create this! 😄

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

No branches or pull requests

1 participant