Skip to main content

bsv.crypto.BN

scrypt-ts / bsv / crypto / BN

Class: BN

bsv.crypto.BN

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new BN(number, base?, endian?)

Parameters

NameType
numberstring | 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

BN

Defined in

node_modules/bsv/index.d.ts:694


add

add(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:695

add(one): BN

Parameters

NameType
oneBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:720


and

and(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:705


bincn

bincn(b): BN

Parameters

NameType
bnumber

Returns

BN

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

BN

Defined in

node_modules/bsv/index.d.ts:668


cmp

cmp(b): number

Parameters

NameType
bany

Returns

number

Defined in

node_modules/bsv/index.d.ts:682


div

div(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:700


divRound

divRound(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:702


egcd

egcd(b): Object

Parameters

NameType
bBN

Returns

Object

NameType
aBN
bBN
gcdBN

Defined in

node_modules/bsv/index.d.ts:716


eq

eq(b): boolean

Parameters

NameType
bany

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:687


eqn

eqn(b): boolean

Parameters

NameType
bany

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:688


gcd

gcd(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:715


gt

gt(b): boolean

Parameters

NameType
bany

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:685


gte

gte(b): boolean

Parameters

NameType
bany

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:686


gten

gten(b): boolean

Parameters

NameType
bany

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:689


invm

invm(b): BN

Parameters

NameType
bBN

Returns

BN

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

NameType
bany

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

NameType
bany

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:683


lte

lte(b): boolean

Parameters

NameType
bany

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:684


lten

lten(b): boolean

Parameters

NameType
bany

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:690


maskn

maskn(b): BN

Parameters

NameType
bnumber

Returns

BN

Defined in

node_modules/bsv/index.d.ts:711


mod

mod(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:701


mul

mul(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:697


neg

neg(): BN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:693

neg(): BN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:719


notn

notn(w): BN

Parameters

NameType
wnumber

Returns

BN

Defined in

node_modules/bsv/index.d.ts:713


or

or(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:704


pow

pow(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:699


setn

setn(b): BN

Parameters

NameType
bnumber

Returns

BN

Defined in

node_modules/bsv/index.d.ts:707


shln

shln(b): BN

Parameters

NameType
bnumber

Returns

BN

Defined in

node_modules/bsv/index.d.ts:708


shrn

shrn(b): BN

Parameters

NameType
bnumber

Returns

BN

Defined in

node_modules/bsv/index.d.ts:709


sqr

sqr(): BN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:698


sub

sub(b): BN

Parameters

NameType
bBN

Returns

BN

Defined in

node_modules/bsv/index.d.ts:696


testn

testn(b): boolean

Parameters

NameType
bnumber

Returns

boolean

Defined in

node_modules/bsv/index.d.ts:710


toArray

toArray(endian?, length?): number[]

Parameters

NameType
endian?Endianness
length?number

Returns

number[]

Defined in

node_modules/bsv/index.d.ts:672


toBuffer

toBuffer(opts?): Buffer

Parameters

NameType
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

NameType
opts?IOpts

Returns

Buffer

Defined in

node_modules/bsv/index.d.ts:721


toString

toString(base?, length?): string

Parameters

NameType
base?number | "hex"
length?number

Returns

string

Defined in

node_modules/bsv/index.d.ts:669


xor

xor(b): BN

Parameters

NameType
bBN

Returns

BN

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

NameType
bufBuffer
opts?IOpts

Returns

BN

Defined in

node_modules/bsv/index.d.ts:723


fromHex

Static fromHex(hex, opts?): BN

Parameters

NameType
hexstring
opts?IOpts

Returns

BN

Defined in

node_modules/bsv/index.d.ts:725


fromNumber

Static fromNumber(n): BN

Parameters

NameType
nnumber

Returns

BN

Defined in

node_modules/bsv/index.d.ts:724


fromSM

Static fromSM(buf, opts?): BN

Parameters

NameType
bufBuffer
opts?IOpts

Returns

BN

Defined in

node_modules/bsv/index.d.ts:718


fromString

Static fromString(hex, base?): BN

Parameters

NameType
hexstring
base?number

Returns

BN

Defined in

node_modules/bsv/index.d.ts:726