mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
crypto: set length when converting uint8array to buffer
This commit is contained in:
committed by
Abdullah Atta
parent
5774daf3a9
commit
e6b9219d75
@@ -412,7 +412,7 @@ function toBuffer<TInput extends ToBufferInput>(
|
||||
input: TInput
|
||||
): ToBufferResult<TInput> {
|
||||
if (input instanceof Uint8Array) {
|
||||
return Buffer.from(input.buffer);
|
||||
return Buffer.from(input.buffer, 0, input.byteLength);
|
||||
} else if (typeof input === "undefined" || input === null) {
|
||||
return undefined as ToBufferResult<TInput>;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user