bsv.crypto.BN
Class: BN
Table of contents
Constructors
Properties
Methods
- abs
- add
- and
- bincn
- bitLength
- byteLength
- clone
- cmp
- div
- divRound
- egcd
- eq
- eqn
- gcd
- gt
- gte
- gten
- invm
- isBN
- isEven
- isNeg
- isOdd
- isZero
- lt
- lte
- lten
- maskn
- mod
- mul
- neg
- notn
- or
- pow
- setn
- shln
- shrn
- sqr
- sub
- testn
- toArray
- toBuffer
- toJSON
- toNumber
- toSM
- toString
- xor
- zeroBits
- fromBuffer
- fromHex
- fromNumber
- fromSM
- fromString
Constructors
constructor
• new BN(number
, base?
, endian?
)
Parameters
Name | Type |
---|---|
number | string | number | bigint | number [] | readonly number [] | Buffer | BN |
base? | number |
endian? | Endianness |
Defined in
node_modules/bsv/index.d.ts:658
Properties
Minus1
▪ Static
Minus1: BN
Defined in
node_modules/bsv/index.d.ts:666
One
▪ Static
One: BN
Defined in
node_modules/bsv/index.d.ts:665
Zero
▪ Static
Zero: BN
Defined in
node_modules/bsv/index.d.ts:664
Methods
abs
▸ abs(): BN
Returns
Defined in
node_modules/bsv/index.d.ts:694
add
▸ add(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:695
▸ add(one
): BN
Parameters
Name | Type |
---|---|
one | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:720
and
▸ and(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:705
bincn
▸ bincn(b
): BN
Parameters
Name | Type |
---|---|
b | number |
Returns
Defined in
node_modules/bsv/index.d.ts:712
bitLength
▸ bitLength(): number
Returns
number
Defined in
node_modules/bsv/index.d.ts:674
byteLength
▸ byteLength(): number
Returns
number
Defined in
node_modules/bsv/index.d.ts:676
clone
▸ clone(): BN
Returns
Defined in
node_modules/bsv/index.d.ts:668
cmp
▸ cmp(b
): number
Parameters
Name | Type |
---|---|
b | any |
Returns
number
Defined in
node_modules/bsv/index.d.ts:682
div
▸ div(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:700
divRound
▸ divRound(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:702
egcd
▸ egcd(b
): Object
Parameters
Name | Type |
---|---|
b | BN |
Returns
Object
Name | Type |
---|---|
a | BN |
b | BN |
gcd | BN |
Defined in
node_modules/bsv/index.d.ts:716
eq
▸ eq(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:687
eqn
▸ eqn(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:688
gcd
▸ gcd(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:715
gt
▸ gt(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:685
gte
▸ gte(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:686
gten
▸ gten(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:689
invm
▸ invm(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:717
isBN
▸ isBN(): boolean
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:681
▸ isBN(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:691
isEven
▸ isEven(): boolean
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:678
isNeg
▸ isNeg(): boolean
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:677
isOdd
▸ isOdd(): boolean
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:679
isZero
▸ isZero(): boolean
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:680
lt
▸ lt(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:683
lte
▸ lte(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:684
lten
▸ lten(b
): boolean
Parameters
Name | Type |
---|---|
b | any |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:690
maskn
▸ maskn(b
): BN
Parameters
Name | Type |
---|---|
b | number |
Returns
Defined in
node_modules/bsv/index.d.ts:711
mod
▸ mod(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:701
mul
▸ mul(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:697
neg
▸ neg(): BN
Returns
Defined in
node_modules/bsv/index.d.ts:693
▸ neg(): BN
Returns
Defined in
node_modules/bsv/index.d.ts:719
notn
▸ notn(w
): BN
Parameters
Name | Type |
---|---|
w | number |
Returns
Defined in
node_modules/bsv/index.d.ts:713
or
▸ or(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:704
pow
▸ pow(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:699
setn
▸ setn(b
): BN
Parameters
Name | Type |
---|---|
b | number |
Returns
Defined in
node_modules/bsv/index.d.ts:707
shln
▸ shln(b
): BN
Parameters
Name | Type |
---|---|
b | number |
Returns
Defined in
node_modules/bsv/index.d.ts:708
shrn
▸ shrn(b
): BN
Parameters
Name | Type |
---|---|
b | number |
Returns
Defined in
node_modules/bsv/index.d.ts:709
sqr
▸ sqr(): BN
Returns
Defined in
node_modules/bsv/index.d.ts:698
sub
▸ sub(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:696
testn
▸ testn(b
): boolean
Parameters
Name | Type |
---|---|
b | number |
Returns
boolean
Defined in
node_modules/bsv/index.d.ts:710
toArray
▸ toArray(endian?
, length?
): number
[]
Parameters
Name | Type |
---|---|
endian? | Endianness |
length? | number |
Returns
number
[]
Defined in
node_modules/bsv/index.d.ts:672
toBuffer
▸ toBuffer(opts?
): Buffer
Parameters
Name | Type |
---|---|
opts? | IOpts |
Returns
Buffer
Defined in
node_modules/bsv/index.d.ts:673
toJSON
▸ toJSON(): string
Returns
string
Defined in
node_modules/bsv/index.d.ts:671
toNumber
▸ toNumber(): number
Returns
number
Defined in
node_modules/bsv/index.d.ts:670
▸ toNumber(): number
Returns
number
Defined in
node_modules/bsv/index.d.ts:722
toSM
▸ toSM(opts?
): Buffer
Parameters
Name | Type |
---|---|
opts? | IOpts |
Returns
Buffer
Defined in
node_modules/bsv/index.d.ts:721
toString
▸ toString(base?
, length?
): string
Parameters
Name | Type |
---|---|
base? | number | "hex" |
length? | number |
Returns
string
Defined in
node_modules/bsv/index.d.ts:669
xor
▸ xor(b
): BN
Parameters
Name | Type |
---|---|
b | BN |
Returns
Defined in
node_modules/bsv/index.d.ts:706
zeroBits
▸ zeroBits(): number
Returns
number
Defined in
node_modules/bsv/index.d.ts:675
fromBuffer
▸ Static
fromBuffer(buf
, opts?
): BN
Parameters
Name | Type |
---|---|
buf | Buffer |
opts? | IOpts |
Returns
Defined in
node_modules/bsv/index.d.ts:723
fromHex
▸ Static
fromHex(hex
, opts?
): BN
Parameters
Name | Type |
---|---|
hex | string |
opts? | IOpts |
Returns
Defined in
node_modules/bsv/index.d.ts:725
fromNumber
▸ Static
fromNumber(n
): BN
Parameters
Name | Type |
---|---|
n | number |
Returns
Defined in
node_modules/bsv/index.d.ts:724
fromSM
▸ Static
fromSM(buf
, opts?
): BN
Parameters
Name | Type |
---|---|
buf | Buffer |
opts? | IOpts |
Returns
Defined in
node_modules/bsv/index.d.ts:718
fromString
▸ Static
fromString(hex
, base?
): BN
Parameters
Name | Type |
---|---|
hex | string |
base? | number |
Returns
Defined in
node_modules/bsv/index.d.ts:726