const times = []
let hash, result, start, end, check, isValid
for (let i = 0; i < size; i++) {
- status.textContent = status.textContent.replace(`${(i || 1) - 1}/${size}`, `${i}/${size}`)
+ const prev = RegExp(`${(i || 1) - 1}/${size}$`)
+ const next = `${i}/${size}`
+ status.textContent = status.textContent.replace(prev, next)
hash = random()
start = performance.now()
result = await NanoPow.work_generate(hash, { difficulty, effort, api })