@ryanburnette/hashcash
v2.1.0
Published
An asynchronous implementation of hashcash for Node.js and the browser.
Downloads
2
Readme
hashcash
An asynchronous implementation of hashcash for Node.js and the browser.
Usage
Require and create an instance. Pass in optional seed string. Pass in optional need string to increase complexity.
var hashcash = require('@ryanburnette/hashcash');
var h = hashcash();
Check to see if a value passes.
h.check(0).then(function(result) {
console.log(result);
});
Do the work.
h.solve().then(function(solution) {
console.log(solution);
});
Package
The package works as-is on Node.js and will work with webpack or rollup for packaged browser use.
For direct browser implementation, use ./dist/hashcash.js
or via cdn...
<script src="https://unpkg.com/@ryanburnette/hashcash/dist/hashcash.js" />