Skip to content

Instantly share code, notes, and snippets.

const crypto = require("crypto");
const terminatingHash =
"86728f5fc3bd99db94d3cdaf105d67788194e9701bf95d049ad0e1ee3d004277";
const salt = "0000000000000000004d6ec16dafe9d8370958664c1dc422f452892264c59526";
function* genHashChain(hash) {
for (let i = 0; hash !== terminatingHash; i++) {
if (i > 10e6) {
throw new Error("Could not find terminating hash, wrong hash chain?!");
}