mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-15 04:58:43 +00:00
Fix when hardwareConcurrency is undefined (#42)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// https://dev.to/ratmd/simple-proof-of-work-in-javascript-3kgm
|
||||
|
||||
export function process(data, difficulty = 5, threads = navigator.hardwareConcurrency) {
|
||||
export function process(data, difficulty = 5, threads = (navigator.hardwareConcurrency || 1)) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let webWorkerURL = URL.createObjectURL(new Blob([
|
||||
'(', processTask(), ')()'
|
||||
|
||||
Reference in New Issue
Block a user