BlockUtils
Static Method Summary
Static Public Methods | ||
public static |
compactToDifficulty(compact: number): number |
|
public static |
compactToTarget(compact: number): number |
|
public static |
difficultyToCompact(difficulty: number): number |
|
public static |
difficultyToTarget(difficulty: number): number |
|
public static |
getHashDepth(hash: Hash): number |
|
public static |
getNextTarget(headBlock: BlockHeader, tailBlock: BlockHeader, deltaTotalDifficulty: number): number |
|
public static |
getTargetDepth(target: number): number |
|
public static |
getTargetHeight(target: number): number |
|
public static |
hashToTarget(hash: Hash): number |
|
public static |
isProofOfWork(hash: Hash, target: number): boolean |
|
public static |
isValidCompact(compact: number): boolean |
|
public static |
isValidTarget(target: number): boolean |
|
public static |
realDifficulty(hash: Hash): number |
|
public static |
targetToCompact(target: number): number |
|
public static |
targetToDifficulty(target: number): number |
Static Public Methods
public static compactToDifficulty(compact: number): number source
Params:
Name | Type | Attribute | Description |
compact | number |
Return:
number |
public static compactToTarget(compact: number): number source
Params:
Name | Type | Attribute | Description |
compact | number |
Return:
number |
public static difficultyToCompact(difficulty: number): number source
Params:
Name | Type | Attribute | Description |
difficulty | number |
Return:
number |
public static difficultyToTarget(difficulty: number): number source
Params:
Name | Type | Attribute | Description |
difficulty | number |
Return:
number |
public static getHashDepth(hash: Hash): number source
Params:
Name | Type | Attribute | Description |
hash | Hash |
Return:
number |
public static getNextTarget(headBlock: BlockHeader, tailBlock: BlockHeader, deltaTotalDifficulty: number): number source
Params:
Name | Type | Attribute | Description |
headBlock | BlockHeader | ||
tailBlock | BlockHeader | ||
deltaTotalDifficulty | number |
Return:
number |
public static getTargetDepth(target: number): number source
Params:
Name | Type | Attribute | Description |
target | number |
Return:
number |
public static getTargetHeight(target: number): number source
Params:
Name | Type | Attribute | Description |
target | number |
Return:
number |
public static hashToTarget(hash: Hash): number source
Params:
Name | Type | Attribute | Description |
hash | Hash |
Return:
number |
public static isProofOfWork(hash: Hash, target: number): boolean source
Params:
Name | Type | Attribute | Description |
hash | Hash | ||
target | number |
Return:
boolean |
public static isValidCompact(compact: number): boolean source
Params:
Name | Type | Attribute | Description |
compact | number |
Return:
boolean |
public static isValidTarget(target: number): boolean source
Params:
Name | Type | Attribute | Description |
target | number |
Return:
boolean |
public static realDifficulty(hash: Hash): number source
Params:
Name | Type | Attribute | Description |
hash | Hash |
Return:
number |
public static targetToCompact(target: number): number source
Params:
Name | Type | Attribute | Description |
target | number |
Return:
number |
public static targetToDifficulty(target: number): number source
Params:
Name | Type | Attribute | Description |
target | number |
Return:
number |