mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-13 22:15:04 +00:00
Remove Buffer
from getSizeOfPayloadSizeField
This commit is contained in:
parent
9e09de831f
commit
95485f0a69
@ -110,8 +110,8 @@ export function clearDecode(
|
||||
}
|
||||
|
||||
function getSizeOfPayloadSizeField(message: Uint8Array): number {
|
||||
const buf = Buffer.from(message);
|
||||
return buf.readUIntLE(0, 1) & FlagMask;
|
||||
const messageDataView = new DataView(message.buffer);
|
||||
return messageDataView.getUint8(0) & FlagMask;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user