Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 928 Bytes

README.md

File metadata and controls

36 lines (22 loc) · 928 Bytes

Hashcash JS

Build Status

A simple npm module to generate a Hashcash signature with challenge, for those times when you're fighting off the spam.

Install

npm install hashcash

or

yarn add hashcash

Usage

import Hashcash from 'hashcash'

Generating a stamp

const stamp = Hashcash.generateStamp(16, "unique-data-goes-here")
console.log(stamp)

Would output something like the following (except the trail):

1:16:20180708232351:unique-data-goes-here::xDnc81q

Assumptions

In this implementation we've used HHMMSS on the timestamp, instead of the original date-only approach. This gives more flexibility to the receiving side for strict checking per minute, second, hour, etc. Changing this precision may be an option in future releases.