ksuid
ksuid copied to clipboard
Incorrect decode timestamp implementation
The current code:
private long decodeTimestamp(final byte[] decodedKsuid) {
final byte[] timestamp = new byte[TIMESTAMP_LENGTH];
System.arraycopy(decodedKsuid, 0, timestamp, 0, TIMESTAMP_LENGTH);
return ByteBuffer.wrap(timestamp).getInt() + EPOCH;
}
The timestamp is however an unsigned 32 bit integer while here it is read as a signed 32 bit integer. Source