console.log(`Geometric Mean: ${geometric} ms`)
}
- console.log(`%cNanoPow`, 'color:green', 'Testing validation function')
+ console.log(`%cNanoPow`, 'color:green', 'Checking validate()')
const expectFalse = await NanoPow.validate('0000000000000000', '0000000000000000000000000000000000000000000000000000000000000000')
console.log(`validate() output for bad nonce is ${expectFalse === false ? 'correct' : 'incorrect'}`)
const expectTrue = await NanoPow.validate('47c83266398728cf', '92BA74A7D6DC7557F3EDA95ADC6341D51AC777A0A6FF0688A5C492AB2B2CB40D')
console.log(`validate() output for good nonce is ${expectTrue === true ? 'correct' : 'incorrect'}`)
-
- console.log(`%cNanoPow `, 'color:green', `Calculate proof-of-work for ${COUNT} unique send block hashes`)
+ const type = (NanoPow === NanoPowGpu) ? 'WebGPU' : (NanoPow === NanoPowGl) ? 'WebGL' : 'unknown API'
+ console.log(`%cNanoPow (${type})`, 'color:green', `Calculate proof-of-work for ${COUNT} unique send block hashes`)
times = []
- document.getElementById('output').innerHTML += `Now testing: NanoPow<br/>`
+ document.getElementById('output').innerHTML += `Now testing: NanoPow (${type})<br/>`
for (let i = 0; i < COUNT; i++) {
const hash = random()
let work = null
document.getElementById('output').innerHTML += `${msg}<br/>`
}
document.getElementById('output').innerHTML += `-----<br/>`
- document.getElementById('summary').innerHTML += `NanoPow<br/>${JSON.stringify(average(times), null, '\t')}<br/>`
+ document.getElementById('summary').innerHTML += `NanoPow (${type})<br/>${JSON.stringify(average(times), null, '\t')}<br/>`
print(times)
console.log(`%cNanoPowGpu `, 'color:green', `Calculate proof-of-work for ${COUNT} unique send block hashes`)
document.getElementById('summary').innerHTML += `nano-webgl-pow<br/>${JSON.stringify(average(times), null, '\t')}<br/>`
print(times)
+ document.getElementById('status').innerHTML = `TESTING COMPLETE<br/>`
console.log('%cTESTING COMPLETE', 'color:orange;font-weight:bold')
</script>
<style>body{background:black;color:white;}a{color:darkcyan;}</style>
<p>nano-webgl-pow is the original package from which NanoPow was inspired and optimized.</p>
<p>Times below are in milliseconds and summarized by various averaging methods.</p>
<hr/>
+ <h3 id="status">TESTING IN PROGRESS</h3>
+ <hr/>
<pre id="summary"></pre>
<hr/>
<pre id="output"></pre>