mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 09:41:45 +00:00
Adds Uint8Array as a valid constructor argument.
``` > new BigNumber(new Uint8Array([0x40, 0x20])).toString(16) '4020' ```
This commit is contained in:
@@ -16,3 +16,8 @@ const red = bn.toRed(ctx);
|
||||
const newRed = red.redAdd(new BN(1));
|
||||
newRed.cmp(bn);
|
||||
newRed.fromRed();
|
||||
|
||||
const expected = new BN(0x4020);
|
||||
const actualArray = new BN([0x40, 0x20]);
|
||||
const actualUint8Array = new BN(new Uint8Array([0x40, 0x20]));
|
||||
const actualString = new BN('0x4020');
|
||||
|
||||
Vendored
+2
-2
@@ -25,12 +25,12 @@ interface ReductionContext {
|
||||
|
||||
declare class BN {
|
||||
constructor(
|
||||
number: number | string | number[] | Buffer | BN,
|
||||
number: number | string | number[] | Uint8Array | Buffer | BN,
|
||||
base?: number | 'hex',
|
||||
endian?: Endianness
|
||||
);
|
||||
constructor(
|
||||
number: number | string | number[] | Buffer | BN,
|
||||
number: number | string | number[] | Uint8Array | Buffer | BN,
|
||||
endian?: Endianness
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user