Constructor
new HashCashPlugin(node, optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
node | object | ||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
Methods
(static) parse(header) → {module:kadence/hashcash~HashCashPlugin~stamp}
Parses hashcash stamp header into an object
Parameters:
Name | Type | Description |
---|---|---|
header | string | Hashcash header proof stamp |
- Source
Returns:
prove()
Add proof of work to outgoing message
- Implements
- Source
verify()
Verifies the proof of work on the request object
- Implements
- Source
Type Definitions
stamp
PropertiesName | Type | Description |
---|---|---|
ver | number | Hashcash version |
bits | number | Number of zero bits of difficulty |
date | number | UNIX timestamp |
resource | string | Sender and target node identities |
ext | string | Empty string |
rand | string | String encoded random number |
counter | number | Base 16 counter |
toString | function | Reserializes the parsed header |
- Source