]> git.codecow.com Git - nano-pow.git/commitdiff
Reuse previously processed hash.
authorChris Duncan <chris@codecow.com>
Mon, 8 Jun 2026 21:00:29 +0000 (14:00 -0700)
committerChris Duncan <chris@codecow.com>
Mon, 8 Jun 2026 21:00:29 +0000 (14:00 -0700)
src/lib/index.ts

index 15dcfbe9e4f7e5019ed1536b995d683d55fd9810..fd2ed4f5699bc5729c3f4f30ad9b28de773f64dc 100644 (file)
@@ -32,16 +32,16 @@ export async function generate (hash: unknown, options?: unknown): Promise<WorkG
                        }
                        switch (api) {
                                case 'webgpu': {
-                                       return Cache.store(await NanoPowWebgpu(bigintFrom(hash, 'hex'), difficulty, effort, debug))
+                                       return Cache.store(await NanoPowWebgpu(bigintHash, difficulty, effort, debug))
                                }
                                case 'webgl': {
-                                       return Cache.store(await NanoPowWebgl(bigintFrom(hash, 'hex'), difficulty, effort, debug))
+                                       return Cache.store(await NanoPowWebgl(bigintHash, difficulty, effort, debug))
                                }
                                case 'wasm': {
-                                       return Cache.store(await NanoPowWasm(bigintFrom(hash, 'hex'), difficulty, effort, debug))
+                                       return Cache.store(await NanoPowWasm(bigintHash, difficulty, effort, debug))
                                }
                                default: {
-                                       return Cache.store(await NanoPowCpu(bigintFrom(hash, 'hex'), difficulty, debug))
+                                       return Cache.store(await NanoPowCpu(bigintHash, difficulty, debug))
                                }
                        }
                } catch (e: any) {