You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 25, 2020. It is now read-only.
* 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! 😄
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Machine id javadoc says it's in the range of
0
-262143
.camflake/camflake/src/main/java/com/camobile/camflake/Camflake.java
Line 45 in 8d840e5
camflake/camflake/src/main/java/com/camobile/camflake/MachineId.java
Line 12 in 8d840e5
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 ofMachineId
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! 😄
The text was updated successfully, but these errors were encountered: