Switch from Uint8Array.from to new Uint8Array
This commit is contained in:
parent
5ae7fc4444
commit
0ca83cf121
|
@ -109,7 +109,7 @@ const util = {
|
||||||
throw new Error('Zero MPI');
|
throw new Error('Zero MPI');
|
||||||
}
|
}
|
||||||
const stripped = bin.subarray(bin.length - Math.ceil(bitSize / 8));
|
const stripped = bin.subarray(bin.length - Math.ceil(bitSize / 8));
|
||||||
const prefix = Uint8Array.from([(bitSize & 0xFF00) >> 8, bitSize & 0xFF]);
|
const prefix = new Uint8Array([(bitSize & 0xFF00) >> 8, bitSize & 0xFF]);
|
||||||
return util.concatUint8Array([prefix, stripped]);
|
return util.concatUint8Array([prefix, stripped]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -827,11 +827,11 @@ V+HOQJQxXJkVRYa3QrFUehiMzTeqqMdgC6ZqJy7+
|
||||||
expect(rawNotations.length).to.equal(2);
|
expect(rawNotations.length).to.equal(2);
|
||||||
|
|
||||||
expect(rawNotations[0].name).to.equal('test@example.com');
|
expect(rawNotations[0].name).to.equal('test@example.com');
|
||||||
expect(rawNotations[0].value).to.deep.equal(Uint8Array.from(['2'.charCodeAt(0)]));
|
expect(rawNotations[0].value).to.deep.equal(new Uint8Array(['2'.charCodeAt(0)]));
|
||||||
expect(rawNotations[0].humanReadable).to.equal(true);
|
expect(rawNotations[0].humanReadable).to.equal(true);
|
||||||
|
|
||||||
expect(rawNotations[1].name).to.equal('test@example.com');
|
expect(rawNotations[1].name).to.equal('test@example.com');
|
||||||
expect(rawNotations[1].value).to.deep.equal(Uint8Array.from(['3'.charCodeAt(0)]));
|
expect(rawNotations[1].value).to.deep.equal(new Uint8Array(['3'.charCodeAt(0)]));
|
||||||
expect(rawNotations[1].humanReadable).to.equal(true);
|
expect(rawNotations[1].humanReadable).to.equal(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -922,7 +922,7 @@ hUhMKMuiM3pRwdIyDOItkUWQmjEEw7/XmhgInkXsCw==
|
||||||
expect(signature.rawNotations.length).to.equal(1);
|
expect(signature.rawNotations.length).to.equal(1);
|
||||||
const notation = signature.rawNotations[0];
|
const notation = signature.rawNotations[0];
|
||||||
expect(notation.name).to.equal('test@key.com');
|
expect(notation.name).to.equal('test@key.com');
|
||||||
expect(notation.value).to.deep.equal(Uint8Array.from([0x01, 0x02, 0x03]));
|
expect(notation.value).to.deep.equal(new Uint8Array([0x01, 0x02, 0x03]));
|
||||||
expect(notation.humanReadable).to.equal(false);
|
expect(notation.humanReadable).to.equal(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user