Constructors
constructor
new BN( number: | string | number | Uint8Array<ArrayBufferLike> | number[] | BN | Buffer<ArrayBufferLike>, base?: number | "hex", endian?: Endianness,): BN Parameters
- number:
| string
| number
| Uint8Array<ArrayBufferLike>
| number[]
| BN
| Buffer<ArrayBufferLike> Optional
base: number | "hex"Optional
endian: Endianness
Returns BN
new BN( number: | string | number | Uint8Array<ArrayBufferLike> | number[] | BN | Buffer<ArrayBufferLike>, endian?: Endianness,): BN Parameters
- number:
| string
| number
| Uint8Array<ArrayBufferLike>
| number[]
| BN
| Buffer<ArrayBufferLike> Optional
endian: Endianness
Returns BN
Properties
Static
BN
Static
wordSize
wordSize: 26
Methods
abs
Returns BN
add
Returns BN
addn
Returns BN
and
Returns BN
andln
Returns BN
bincn
Returns BN
bitLength
Returns number
byteLength
Returns number
clone
Returns BN
cmp
Returns -1 | 0 | 1
cmpn
cmpn(b: number): -1 | 0 | 1 Returns -1 | 0 | 1
copy
Returns void
div
Returns BN
divmod
divmod(b: BN, mode?: "div" | "mod", positive?: boolean): { div: BN; mod: BN } Parameters
- b: BN
Optional
mode: "div" | "mod"Optional
positive: boolean
Returns { div: BN; mod: BN }
divn
Returns BN
divRound
Returns BN
egcd
Returns { a: BN; b: BN; gcd: BN }
eq
Returns boolean
eqn
Returns boolean
fromTwos
fromTwos(width: number): BN Returns BN
gcd
Returns BN
gt
Returns boolean
gte
Returns boolean
gten
Returns boolean
gtn
Returns boolean
iabs
Returns BN
iadd
Returns BN
iaddn
Returns BN
iand
Returns BN
idivn
Returns BN
imaskn
Returns BN
imul
Returns BN
imuln
Returns BN
ineg
Returns BN
inotn
Returns BN
invm
Returns BN
ior
Returns BN
isEven
Returns boolean
ishln
Returns BN
ishrn
Returns BN
isNeg
Returns boolean
isOdd
Returns boolean
isqr
Returns BN
isub
Returns BN
isubn
Returns BN
isZero
Returns boolean
iuand
Returns BN
iuor
Returns BN
iushln
Returns BN
iushrn
Returns BN
iuxor
Returns BN
ixor
Returns BN
lt
Returns boolean
lte
Returns boolean
lten
Returns boolean
ltn
Returns boolean
maskn
Returns BN
mod
Returns BN
modn
Returns number
modrn
Returns number
mul
Returns BN
muln
Returns BN
neg
Returns BN
notn
Returns BN
or
Returns BN
pow
Returns BN
setn
setn(b: number, value: boolean | 0 | 1): BN Parameters
- b: number
- value: boolean | 0 | 1
Returns BN
shln
Returns BN
shrn
Returns BN
sqr
Returns BN
sub
Returns BN
subn
Returns BN
testn
testn(b: number): boolean Returns boolean
toArray
toArray(endian?: Endianness, length?: number): number[] Returns number[]
toArrayLike
toArrayLike( ArrayType: BufferConstructor, endian?: Endianness, length?: number,): Buffer Parameters
- ArrayType: BufferConstructor
Optional
endian: EndiannessOptional
length: number
Returns Buffer
toArrayLike(ArrayType: any[], endian?: Endianness, length?: number): any[] Parameters
- ArrayType: any[]
Optional
endian: EndiannessOptional
length: number
Returns any[]
toBuffer
toBuffer(endian?: Endianness, length?: number): Buffer Returns Buffer
toJSON
Returns string
toNumber
Returns number
toRed
Returns RedBN
toString
toString(base?: number | "hex", length?: number): string Parameters
Optional
base: number | "hex"Optional
length: number
Returns string
toTwos
toTwos(width: number): BN Returns BN
uand
Returns BN
ucmp
Returns -1 | 0 | 1
umod
Returns BN
uor
Returns BN
ushln
Returns BN
ushrn
Returns BN
uxor
Returns BN
xor
Returns BN
zeroBits
Returns number
Static
isBN
Returns b is BN
Static
max
Returns BN
Static
min
Returns BN
Static
mont
Static
red
Description
absolute value