Implements proof of work.
- Source:
- See:
Methods
(static) check(opts) → {boolean}
Check a POW.
Parameters:
Name | Type | Description |
---|---|---|
opts |
Object | Proof of work options |
Returns:
Is the proof of work sufficient.
- Type
- boolean
(static) doAsync(opts) → {Promise.<number>}
Do a POW.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object | Proof of work options Properties
|
Returns:
A promise that contains computed nonce for the given target when fulfilled.
- Type
- Promise.<number>
(static) getTarget(opts) → {number}
Calculate target.
Parameters:
Name | Type | Description |
---|---|---|
opts |
Object | Target options |
Returns:
Target.
- Type
- number