Skip to content

Instantly share code, notes, and snippets.

@lona91
lona91 / pow.js
Created May 27, 2021 12:50
Proof of Woork Example
const crypto = require('crypto')
const perf_hooks = require('perf_hooks')
const LEADING_ZEROS = 4;
function check(hash) {
for (let i = 0; i < LEADING_ZEROS; i++) {
if (hash[i] !== '0') {
return false;

Keybase proof

I hereby claim:

  • I am lona91 on github.
  • I am luca91 (https://keybase.io/luca91) on keybase.
  • I have a public key ASABhxSWxp_uqtJ6D_VRwYmgLJnIRdAaDDxwsGXOg9lXDgo

To claim this, I am signing this object: