-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
57 lines (51 loc) · 1.25 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
declare module 'bn.js' {
import { Buffer } from 'buffer'
type Endianness = 'le'|'be'
class BN {
constructor(number: number|string|number[]|Buffer, base?: number, endian?: Endianness)
clone(): BN
toString(base?: number, length?: number): string
toNumber(): number
toJSON(): string
toArray(endian?: Endianness, length?: number): number[]
toBuffer(endian?: Endianness, length?: number): Buffer
bitLength(): number
zeroBits(): number
byteLength(): number
isNeg(): boolean
isEven(): boolean
isOdd(): boolean
isZero(): boolean
cmp(b: any): number
lt(b: any): boolean
lte(b: any): boolean
gt(b: any): boolean
gte(b: any): boolean
eq(b: any): boolean
isBN(b: any): boolean
neg(): BN
abs(): BN
add(b: BN): BN
sub(b: BN): BN
mul(b: BN): BN
sqr(): BN
pow(b: BN): BN
div(b: BN): BN
mod(b: BN): BN
divRound(b: BN): BN
or(b: BN): BN
and(b: BN): BN
xor(b: BN): BN
setn(b: number): BN
shln(b: number): BN
shrn(b: number): BN
testn(b: number): boolean
maskn(b: number): BN
bincn(b: number): BN
notn(w: number): BN
gcd(b: BN): BN
egcd(b: BN): { a: BN, b: BN, gcd: BN }
invm(b: BN): BN
}
export = BN
}