A simple npm module to generate a Hashcash signature with challenge, for those times when you're fighting off the spam.
npm install hashcash
or
yarn add hashcash
import Hashcash from 'hashcash'
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
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.