We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1cb735a commit db39bcbCopy full SHA for db39bcb
1 file changed
src/datatypes/checksums.js
@@ -12,11 +12,9 @@ function computeChatChecksum (lastSeenMessages) {
12
checksum = (31 * checksum + sigHash) & 0xffffffff
13
}
14
15
- // Convert to signed byte (i8: -128..127) to match the chat_command_signed packet schema.
16
- // The previous `& 0xff` produced 0..255 which causes RangeError when value > 127.
17
- const unsigned = checksum & 0xff
18
- const signed = unsigned > 127 ? unsigned - 256 : unsigned
19
- return signed === 0 ? 1 : signed
+ // Convert to byte
+ const result = checksum & 0xff
+ return result === 0 ? 1 : result
20
21
22
module.exports = { computeChatChecksum }
0 commit comments