fix: uint

This commit is contained in:
手瓜一十雪 2024-07-26 13:25:19 +08:00
parent 1dc844435a
commit 9685931694

View File

@ -74,7 +74,7 @@ class MessageUniqueWrapper {
createMsg(peer: Peer, msgId: string): number | undefined {
const key = `${msgId}|${peer.chatType}|${peer.peerUid}`;
const hash = crypto.createHash('sha1').update(key);
const shortId = parseInt(hash.digest('hex').slice(0, 8), 16);
const shortId = Buffer.from(hash.digest('hex').slice(0, 8),'hex').readInt32BE();
const isExist = this.msgIdMap.getKey(shortId);
//console.log(`${peer.peerUid} ${msgId} ------- ${shortId}`);
if (isExist && isExist === msgId) {