v[c] += v[d]
v[b] ^= v[c]
v[b] = (v[b] >> 24n) | (v[b] << 40n)
-
v[a] += v[b]
v[a] += m[y]
v[d] ^= v[a]
}
this.#v[0] ^= 0x01010008n // depth = 1; fanout = 1; outlen = 8
this.#v[12] ^= 40n // Output length
+ this.#v[14] = ~this.#v[14] // Compression
// Set up input buffers
this.#mView.setBigUint64(0, seed, true)
: BigInt(`0x${options.threshold}00000000`)
this.#debug = !!(options?.debug)
- // let attempts = 0n
+ let attempts = 0n
let result = 0n
let nonce = 0n
- // let start = performance.now()
+ let start = performance.now()
do {
- // attempts++
+ attempts++
const random0 = Math.floor(Math.random() * 0xffffffff)
const random1 = Math.floor(Math.random() * 0xffffffff)
nonce = (BigInt(random0) << 32n) | BigInt(random1)
- // if (this.#debug) console.log(`seed: ${seed.toString(16).padStart(16, '0')}`)
result = this.#hash(nonce, hash)
- // if (this.#debug) console.log(performance.now() - start)
+ if (attempts % 1000000n === 0n) console.log(`${attempts} attempts`)
} while (result < threshold)
+ console.log(performance.now() - start)
this.#busy = false
return result.toString(16).padStart(16, '0')
}