@ryanburnette/hashcash

2.1.0 • Public • Published

hashcash

repo npm

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" />

Dependents (0)

Package Sidebar

Install

npm i @ryanburnette/hashcash

Weekly Downloads

9

Version

2.1.0

License

ISC

Unpacked Size

9.61 kB

Total Files

15

Last publish

Collaborators

  • ryanburnette