You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code assumes the buffer only contains the bytes of the ArrayBuffer view, but the Uint8Array buffer could be larger than the view. Buffer.from should also include the offset and length.
} else if (value instanceof Uint8Array) {
- return Buffer.from(value.buffer)+ return Buffer.from(value.buffer, value.byteOffset, value.byteLength)
} else if (typeof value === 'number') {
https://github.com/merkletreejs/merkletreejs/blob/master/src/Base.ts#L173
The code assumes the buffer only contains the bytes of the ArrayBuffer view, but the Uint8Array buffer could be larger than the view.
Buffer.from
should also include the offset and length.Example of
Buffer.from(arrayBuffer[, byteOffset[, length]])
from https://nodejs.org/api/buffer.html#static-method-bufferfromarraybuffer-byteoffset-lengthThe text was updated successfully, but these errors were encountered: