atom wrong subarray
This commit is contained in:
parent
6cdfca4363
commit
d89fcfb76f
|
@ -254,7 +254,7 @@ export class Bert {
|
|||
};
|
||||
decode_atom = (buffer, count) => {
|
||||
const size = this.bytesToInt(buffer, count, true);
|
||||
buffer = Buffer.from(buffer, count);
|
||||
buffer = buffer.subarray(count);
|
||||
let value = buffer.toString("utf8", 0, size);
|
||||
if (value === "true") {
|
||||
value = true;
|
||||
|
|
|
@ -299,7 +299,7 @@ export class Bert {
|
|||
|
||||
decode_atom = (buffer: Buffer, count: 1 | 2 | 4) => {
|
||||
const size = this.bytesToInt(buffer, count, true);
|
||||
buffer = Buffer.from(buffer, count);
|
||||
buffer = buffer.subarray(count);
|
||||
let value: any = buffer.toString("utf8", 0, size);
|
||||
if (value === "true") {
|
||||
value = true;
|
||||
|
|
Loading…
Reference in New Issue