]> zoso.dev Git - libnemo.git/commitdiff
Rename pow worker file to indicate it uses WebGL so that we can perhaps port to a...
authorChris Duncan <chris@zoso.dev>
Thu, 19 Dec 2024 13:27:26 +0000 (05:27 -0800)
committerChris Duncan <chris@zoso.dev>
Thu, 19 Dec 2024 13:27:26 +0000 (05:27 -0800)
src/lib/blake2b.ts
src/lib/workers.ts
src/lib/workers/powgl.ts [moved from src/lib/workers/pow.ts with 99% similarity]
src/main.ts

index cc960c1a4094b8e372b08158556bf4ec5d08bc83..d80ef22008a06b43e603cad6f7385fa14a3717ca 100644 (file)
@@ -164,7 +164,7 @@ export class Blake2b {
        * Note we're representing 16 uint64s as 32 uint32s
        */
        static blake2bCompress (ctx: any, last: boolean): void {
-               var i = 0
+               let i = 0
 
                // init work variables
                for (i = 0; i < 16; i++) {
index b2f7f36b065570747f1da1f3a62775411c090c54..d92a5bdfe50387183d3fa08212dde619fa0fc52e 100644 (file)
@@ -1,7 +1,7 @@
 import { Bip44Ckd } from './workers/bip44-ckd.js'
 import { NanoNaCl, worker as NanoNaClWorker } from './workers/nano-nacl.js'
 // import './workers/passkey.js'
-import { Pow } from './workers/pow.js'
+import { Pow } from './workers/powgl.js'
 
 
 const w = () => {
similarity index 99%
rename from src/lib/workers/pow.ts
rename to src/lib/workers/powgl.ts
index deedba60b1799d7776488ce2dcc921aff48daf14..c2eae5a186831a5e59e6142ff10baabfc0d62278 100644 (file)
@@ -198,7 +198,7 @@ void main() {
 }`
 
        /** Used to set canvas size. Must be a multiple of 256. */
-       static #WORKLOAD: number = 256 * Math.max(1, Math.floor(navigator.hardwareConcurrency))
+       static #WORKLOAD: number = 256 * Math.max(1, Math.floor(navigator.hardwareConcurrency) / 2)
 
        static #hexify (arr: number[] | Uint8Array): string {
                let out = ''
index 8ac28a2beae2673db9bb80c79ad8630254b50a64..8f12d1146c9936e1a0cdd2c6492c9f0ed38658cb 100644 (file)
@@ -4,7 +4,7 @@
 import { Account } from './lib/account.js'
 import { Blake2b } from './lib/blake2b.js'
 import { SendBlock, ReceiveBlock, ChangeBlock } from './lib/block.js'
-import { Pow } from './lib/workers/pow.js'
+import { Pow } from './lib/workers/powgl.js'
 import { Rpc } from './lib/rpc.js'
 import { Rolodex } from './lib/rolodex.js'
 import { Safe } from './lib/safe.js'