Module: bitmessage/pow

Implements proof of work.

Source:
See:

Methods

(static) check(opts) → {boolean}

Check a POW.

Parameters:
Name Type Description
opts Object

Proof of work options

Source:
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
Name Type Attributes Description
data Buffer <nullable>

Object message payload without nonce to get the initial hash from

initialHash Buffer <nullable>

Or already computed initial hash

target number

POW target

Source:
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

Source:
Returns:

Target.

Type
number