Skip to content

Commit

Permalink
Use unsigned byte value to generate prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
kiszk committed Jul 9, 2017
1 parent ac86eed commit 0fea784
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static long getPrefix(byte[] bytes) {
final int minLen = Math.min(bytes.length, 8);
long p = 0;
for (int i = 0; i < minLen; ++i) {
p |= (128L + Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i))
p |= ((long)Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
<< (56 - 8 * i);
}
return p;
Expand Down

0 comments on commit 0fea784

Please sign in to comment.