mirror of https://github.com/waku-org/js-waku.git
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…
Reference in New Issue