JSPM

echashcash

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q20213F
  • License MIT

An easy way to generate and verify hashcash

Package Exports

  • echashcash

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (echashcash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ecHashcash

An easy way to generate and verify hashcash

Install

npm install echashcash

Use

Generate Hashcash

const echashcash = require('echashcash');

/* with default level (3)  */
var content = 'some content';
echashcash(content);

/* with custom level  */
var content = 'some content';
var level = 5;
echashcash(content, level);

/* with custom token (HEX)  */
var content = 'some content';
var token = 'bb8';
echashcash(content, token);

Verify Hashcash

const echashcash = require('echashcash');

/* with default level (3)  */
var content = 'some content';
var hashcash = 2375
echashcash.check(content, hashcash);

/* with custom level  */
var content = 'some content';
var level = 5;
var hashcash = 383173;
echashcash.check(content, hashcash, level);

/* with custom token (HEX)  */
var content = 'some content';
var token = 'bb8';
var hashcash = 873;
echashcash.check(content, hashcash, token);