fix: uint
This commit is contained in:
1 parent
1dc844435a
commit
81d5ea781b
1 file changed
+1
-1
@@ -74,7 +74,7 @@ class MessageUniqueWrapper {
|
|||||||
createMsg(peer: Peer, msgId: string): number | undefined {
|
createMsg(peer: Peer, msgId: string): number | undefined {
|
||||||
const key = `${msgId}|${peer.chatType}|${peer.peerUid}`;
|
const key = `${msgId}|${peer.chatType}|${peer.peerUid}`;
|
||||||
const hash = crypto.createHash('sha1').update(key);
|
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);
|
const isExist = this.msgIdMap.getKey(shortId);
|
||||||
//console.log(`${peer.peerUid} ${msgId} ------- ${shortId}`);
|
//console.log(`${peer.peerUid} ${msgId} ------- ${shortId}`);
|
||||||
if (isExist && isExist === msgId) {
|
if (isExist && isExist === msgId) {
|
||||||
|
|||||||
Reference in new issue
Block a user