import ckdBip44 from './workers/ckdBip44.js'
import ckdBlake2b from './workers/ckdBlake2b.js'
-export { ckdBip44, ckdBlake2b }
// import './workers/nano-nacl.js'
// import './workers/passkey.js'
+export { ckdBip44, ckdBlake2b }
const BIP44_PURPOSE = 44
const HARDENED_OFFSET = 0x80000000
const SLIP10_ED25519 = 'ed25519 seed'
-let addEventListener = globalThis.addEventListener
-let postMessage = globalThis.postMessage
-if (addEventListener == null || postMessage == null) {
- const { isMainThread, parentPort } = await import('node:worker_threads')
- if (!isMainThread && parentPort) {
- addEventListener = Object.getPrototypeOf(parentPort).addListener.bind(parentPort)
- postMessage = Object.getPrototypeOf(parentPort).postMessage.bind(parentPort)
- }
-}
/**
* Listens for messages from a calling function.
import blake2b from 'blake2b'
-let addEventListener = globalThis.addEventListener
-let postMessage = globalThis.postMessage
-if (addEventListener == null || postMessage == null) {
- const { isMainThread, parentPort } = await import('node:worker_threads')
- if (!isMainThread && parentPort) {
- addEventListener = Object.getPrototypeOf(parentPort).addListener.bind(parentPort)
- postMessage = Object.getPrototypeOf(parentPort).postMessage.bind(parentPort)
- }
-}
-
/**
* Listens for messages from a calling function.
*/