{"_id":"@hugomrdias/commp-wasm","_rev":"6-273bde10fedf485af649f5d012f2611e","name":"@hugomrdias/commp-wasm","dist-tags":{"latest":"0.1.4"},"versions":{"0.0.0":{"name":"@hugomrdias/commp-wasm","version":"0.0.0","keywords":["filecoin","commp","piece-commitment","wasm","merkle-tree","fr32"],"license":"MIT","_id":"@hugomrdias/commp-wasm@0.0.0","maintainers":[{"name":"hugomrdias","email":"hugomrdias@gmail.com"}],"dist":{"shasum":"5a3f7ee152e3074572367e82ce66134dcffa1330","tarball":"https://registry.npmjs.org/@hugomrdias/commp-wasm/-/commp-wasm-0.0.0.tgz","fileCount":8,"integrity":"sha512-qUo5XLy0oN8JLlFOoAjK2U6LoBCBAFtfQWEDTIVrxVWUrpUGRhUkg8H1utVvNckoyhEN9p/4RCkeQlwV8Q8VPw==","signatures":[{"sig":"MEUCIFDjpsWZpqnDK3CQz1XN0gvujb3K/sYN46L0ii1JXI2+AiEA/88nIZLNuAOL7bmKpEJg8i1y2x1etBTsoFohY6OVgiM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48151},"main":"./src/index.js","type":"module","types":"./src/types.ts","exports":{".":{"types":"./src/types.ts","import":"./src/index.js"}},"scripts":{"lint":"biome check .","test":"mocha \"tests/**/*.test.js\"","clean":"rm -rf pkg-bundler","build:rust":"cd ../../rs/commp && RUSTFLAGS=\"-C target-feature=+simd128 --remap-path-prefix=${CARGO_HOME:-$HOME/.cargo}=/cargo\" wasm-pack build --target bundler --out-dir ../../packages/commp-wasm/pkg-bundler --release","build:wasm":"pnpm build:rust && pnpm build:inline","build:inline":"node scripts/build-inline-wasm.js"},"_npmUser":{"name":"hugomrdias","email":"hugomrdias@gmail.com"},"repository":{"url":"git+https://github.com/hugomrdias/commp.git","type":"git","directory":"packages/commp-wasm"},"description":"Fast CommP (Filecoin Piece Commitment) WASM implementation with inline base64","directories":{},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^12.0.2","@hugomrdias/commp-js":"0.0.0","@web3-storage/data-segment":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commp-wasm_0.0.0_1790760922276_0.6943940326939968","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@hugomrdias/commp-wasm","version":"0.1.0","keywords":["filecoin","commp","piece-commitment","wasm","merkle-tree","fr32"],"license":"MIT","_id":"@hugomrdias/commp-wasm@0.1.0","maintainers":[{"name":"hugomrdias","email":"hugomrdias@gmail.com"}],"dist":{"shasum":"ff9a44fdb8f880c377dd2c41fc10a676c2dac6ba","tarball":"https://registry.npmjs.org/@hugomrdias/commp-wasm/-/commp-wasm-0.1.0.tgz","fileCount":9,"integrity":"sha512-qcCOsvPYydIOUgX6jwu9OgyAoP+5pWqJ2tVx4oCuQwo+2Zu9a619y91XxUvJiqJkS0l3T5pEGBzyHA0PcQARfg==","signatures":[{"sig":"MEUCIQD6Kf5t4/b3MV/OZUsApB1j21YhsHiwxLfNnQ4P3OYFIgIgA1wLEFAOzDBhoBJ1UCV1jzk3o2bTXg0OYi83nvv4emI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCICSnXfGmspT1+WwiJ34WMQTcvjA2hJT7Yr2kxLVK6QwEAiEA5lhD5UNOXT0q7Po0V2/mGmJA13X6+YMYAnNRq+EE8o0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@hugomrdias%2fcommp-wasm@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":48676},"main":"./src/index.js","type":"module","types":"./src/types.ts","exports":{".":{"types":"./src/types.ts","import":"./src/index.js"}},"scripts":{"lint":"biome check .","test":"mocha \"tests/**/*.test.js\"","clean":"rm -rf pkg-bundler","build:rust":"cd ../../rs/commp && RUSTFLAGS=\"-C target-feature=+simd128 --remap-path-prefix=${CARGO_HOME:-$HOME/.cargo}=/cargo\" wasm-pack build --target bundler --out-dir ../../packages/commp-wasm/pkg-bundler --release","build:wasm":"pnpm build:rust && pnpm build:inline","build:inline":"node scripts/build-inline-wasm.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"fe59165e-0895-44d5-935f-b0de13bcf64e"}},"repository":{"url":"git+https://github.com/hugomrdias/commp.git","type":"git","directory":"packages/commp-wasm"},"description":"Fast CommP (Filecoin Piece Commitment) WASM implementation with inline base64","directories":{},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^12.0.2","@hugomrdias/commp-js":"0.1.0","@web3-storage/data-segment":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commp-wasm_0.1.0_1790770004151_0.7211724644008022","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@hugomrdias/commp-wasm","version":"0.1.1","keywords":["filecoin","commp","piece-commitment","wasm","merkle-tree","fr32"],"license":"MIT","_id":"@hugomrdias/commp-wasm@0.1.1","maintainers":[{"name":"hugomrdias","email":"hugomrdias@gmail.com"}],"dist":{"shasum":"da8acf5633c6820cfe009b2cdd0c1b16a27978c6","tarball":"https://registry.npmjs.org/@hugomrdias/commp-wasm/-/commp-wasm-0.1.1.tgz","fileCount":9,"integrity":"sha512-KJimup0t4Kl+Msei8E2/UE4LKx/OMdmSpeHNfbLX6nxNwuavd+PIKbht78JzcWw/jLSGCyJzVtt6SBzlMtx+xQ==","signatures":[{"sig":"MEYCIQCuABn8yHfnpufYcUMc9+Z5A62pQAa6u2iSzw4ok0/cmwIhAPx8pPAhtr42Fwpyvy/U5twNhV3+uX9RIHk+RM//jNUi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIF4YCpCMH1/CbKVhw1Ai7EEfr2s8I9Z5ScqaEEnEq6qDAiEAyXwg3DNnlkjkSKQwLtVrrAY2hiX5iw61l9NmmICPIJg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@hugomrdias%2fcommp-wasm@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":48988},"main":"./src/index.js","type":"module","types":"./src/types.ts","exports":{".":{"types":"./src/types.ts","import":"./src/index.js"}},"scripts":{"lint":"biome check .","test":"mocha \"tests/**/*.test.js\"","clean":"rm -rf pkg-bundler","build:rust":"cd ../../rs/commp && RUSTFLAGS=\"-C target-feature=+simd128 --remap-path-prefix=${CARGO_HOME:-$HOME/.cargo}=/cargo\" wasm-pack build --target bundler --out-dir ../../packages/commp-wasm/pkg-bundler --release","build:wasm":"pnpm build:rust && pnpm build:inline","build:inline":"node scripts/build-inline-wasm.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"fe59165e-0895-44d5-935f-b0de13bcf64e"}},"repository":{"url":"git+https://github.com/hugomrdias/commp.git","type":"git","directory":"packages/commp-wasm"},"description":"Fast CommP (Filecoin Piece Commitment) WASM implementation with inline base64","directories":{},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^12.0.2","@hugomrdias/commp-js":"0.1.0","@web3-storage/data-segment":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commp-wasm_0.1.1_1790771920479_0.6720480598735801","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@hugomrdias/commp-wasm","version":"0.1.2","keywords":["filecoin","commp","piece-commitment","wasm","merkle-tree","fr32"],"license":"MIT","_id":"@hugomrdias/commp-wasm@0.1.2","maintainers":[{"name":"hugomrdias","email":"hugomrdias@gmail.com"}],"dist":{"shasum":"73b41906b35ec5b1cae48059e772eb536a69f99d","tarball":"https://registry.npmjs.org/@hugomrdias/commp-wasm/-/commp-wasm-0.1.2.tgz","fileCount":16,"integrity":"sha512-ae3TomsHf35WMo5MR/STKIoBqf3eFNCK8OaQQIjG8RABCpE5Ag0mat+MqqpwhuMJbprHD0ekUGOQDO6aVLF0qg==","signatures":[{"sig":"MEYCIQCOciEnPQSUG+P9hgQ9KJqetYRHibEEHy+9MN5R/oMNjAIhAMSkkLk55I5B9G58bs6uWmICvySLF7S7+yheqPhDDe6W","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCTUlgOKbVGKqHSIZVIxHR2xgYDXETpsDxWarPnkNjnQwIhAKDwY1MNj6eH5nPsAL/Ul0dng3SHJYRynMM+V8zqAXYJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@hugomrdias%2fcommp-wasm@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":58705},"main":"./src/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./src/index.js"}},"scripts":{"lint":"biome check .","test":"tsc -p tests && mocha \"tests/**/*.test.js\"","build":"tsc -p tsconfig.json","clean":"rm -rf pkg-bundler dist","build:rust":"cd ../../rs/commp && RUSTFLAGS=\"-C target-feature=+simd128 --remap-path-prefix=${CARGO_HOME:-$HOME/.cargo}=/cargo\" wasm-pack build --target bundler --out-dir ../../packages/commp-wasm/pkg-bundler --release","build:wasm":"pnpm build:rust && pnpm build:inline","build:inline":"node scripts/build-inline-wasm.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"fe59165e-0895-44d5-935f-b0de13bcf64e"}},"repository":{"url":"git+https://github.com/hugomrdias/commp.git","type":"git","directory":"packages/commp-wasm"},"description":"Fast CommP (Filecoin Piece Commitment) WASM implementation with inline base64","directories":{},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^12.0.2","typescript":"^7.0.2","@hugomrdias/commp-js":"0.1.1","@web3-storage/data-segment":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commp-wasm_0.1.2_1790861648780_0.565723741120957","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@hugomrdias/commp-wasm","version":"0.1.3","keywords":["filecoin","commp","piece-commitment","wasm","merkle-tree","fr32"],"license":"MIT","_id":"@hugomrdias/commp-wasm@0.1.3","maintainers":[{"name":"hugomrdias","email":"hugomrdias@gmail.com"}],"dist":{"shasum":"c3b1fc7df2853b6826d61248cf14e161c3e93d94","tarball":"https://registry.npmjs.org/@hugomrdias/commp-wasm/-/commp-wasm-0.1.3.tgz","fileCount":16,"integrity":"sha512-IphAY4N5B+KnX/9+ObIanbuPPNrDu2u+9ZoJ0yIryK2UwZp7gOyp7j6Z/1hFh+PxuEKcjgzuFo1/vNhAFfSkEA==","signatures":[{"sig":"MEYCIQDzq7ZMoKr7H32W7oaN5GuM7PGe1gYrtQV3a/TQBIiZowIhALfyY0vBfW8ntLGr5XssS7E+2hkaqqgLefuaAKPHAcMP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQC70di+IC6musMgulUJKA643vWXj0mDs46ctpAtXArYtQIgd1ZHZ0v2jX91ckxD62jNEdatYKMngOPVPIp0Awgl7zw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@hugomrdias%2fcommp-wasm@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":60369},"main":"./src/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./src/index.js"}},"scripts":{"lint":"biome check .","test":"tsc -p tests && mocha \"tests/**/*.test.js\"","build":"tsc -p tsconfig.json","clean":"rm -rf pkg-bundler dist","build:rust":"cd ../../rs/commp && RUSTFLAGS=\"-C target-feature=+simd128 --remap-path-prefix=${CARGO_HOME:-$HOME/.cargo}=/cargo\" wasm-pack build --target bundler --out-dir ../../packages/commp-wasm/pkg-bundler --release","build:wasm":"pnpm build:rust && pnpm build:inline","build:inline":"node scripts/build-inline-wasm.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"fe59165e-0895-44d5-935f-b0de13bcf64e"}},"repository":{"url":"git+https://github.com/hugomrdias/commp.git","type":"git","directory":"packages/commp-wasm"},"description":"Fast CommP (Filecoin Piece Commitment) WASM implementation with inline base64","directories":{},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^12.0.2","typescript":"^7.0.2","@hugomrdias/commp-js":"0.1.1","@web3-storage/data-segment":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commp-wasm_0.1.3_1792081916898_0.5046165652796597","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"_id":"@hugomrdias/commp-wasm@0.1.4","dist":{"shasum":"df3c82fa2c64c8943b222512efbd3aaf09472829","tarball":"https://registry.npmjs.org/@hugomrdias/commp-wasm/-/commp-wasm-0.1.4.tgz","fileCount":26,"integrity":"sha512-e2oiHAmjtFZ3cxalwqJQgxW8FHlFqj0cXN6PM4NPEhEH/Mf5wjLBzlslA11hUsyOMmMK9+WtWPPNycg5RdiBKg==","signatures":[{"sig":"MEUCIA/1AFHtK7GMWf7JiX8CeUlJgCK9Z41ZMga4tKDG5rQUAiEA+EVangIaYXBwXwDV3Wsj41lwpUWCVfn2teLfjciUZfA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEh43710VHLt8rfemSLMe2Be4MJ44SBk12W3RT+MfkQhAiEAwO4o/JvAVOL+MHjK0FGfRLfK3614W7qBdAM0u/ssg08="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@hugomrdias%2fcommp-wasm@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":86241},"main":"./src/index.js","name":"@hugomrdias/commp-wasm","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./src/index.js","workerd":"./src/index.workerd.js"}},"license":"MIT","scripts":{"lint":"biome check .","test":"tsc -p tests && mocha \"tests/*.test.js\" && pnpm test:workerd","build":"tsc -p tsconfig.json","clean":"rm -rf pkg-bundler dist","build:rust":"cd ../../rs/commp && RUSTFLAGS=\"-C target-feature=+simd128 --remap-path-prefix=${CARGO_HOME:-$HOME/.cargo}=/cargo\" wasm-pack build --target bundler --out-dir ../../packages/commp-wasm/pkg-bundler --release","build:wasm":"pnpm build:rust && pnpm build:inline","build:inline":"node scripts/build-inline-wasm.js","test:workerd":"vitest run --config tests/workerd/vitest.config.js"},"version":"0.1.4","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"fe59165e-0895-44d5-935f-b0de13bcf64e"}},"keywords":["filecoin","commp","piece-commitment","wasm","merkle-tree","fr32"],"repository":{"url":"git+https://github.com/hugomrdias/commp.git","type":"git","directory":"packages/commp-wasm"},"description":"Fast CommP (Filecoin Piece Commitment) WASM implementation with inline base64","directories":{},"maintainers":[{"name":"hugomrdias","email":"hugomrdias@gmail.com"}],"_hasShrinkwrap":false,"devDependencies":{"mocha":"^12.0.2","vitest":"^4.1.11","typescript":"^7.0.2","@hugomrdias/commp-js":"0.1.1","@cloudflare/vitest-plugin":"^1.4.3","@web3-storage/data-segment":"^5.3.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/commp-wasm_0.1.4_1792167335806_0.9862515581027202"}}},"time":{"created":"2026-09-30T09:35:21.886Z","modified":"2026-10-16T16:15:36.338Z","0.0.0":"2026-09-30T09:35:22.413Z","0.1.0":"2026-09-30T12:06:44.257Z","0.1.1":"2026-09-30T12:38:40.552Z","0.1.2":"2026-10-01T13:34:08.883Z","0.1.3":"2026-10-15T16:31:56.993Z","0.1.4":"2026-10-16T16:15:35.913Z"},"license":"MIT","keywords":["filecoin","commp","piece-commitment","wasm","merkle-tree","fr32"],"repository":{"url":"git+https://github.com/hugomrdias/commp.git","type":"git","directory":"packages/commp-wasm"},"description":"Fast CommP (Filecoin Piece Commitment) WASM implementation with inline base64","maintainers":[{"name":"hugomrdias","email":"hugomrdias@gmail.com"}],"readme":"# @hugomrdias/commp-wasm\n\nFast CommP (Filecoin Piece Commitment) in Rust/WASM with 4-lane SIMD SHA-256. The WASM is inlined as base64, so there is no async init and no bundler configuration.\n\n## Install\n\n```bash\nnpm install @hugomrdias/commp-wasm\n```\n\n## Usage\n\n```javascript\nimport { create, digest, root } from '@hugomrdias/commp-wasm'\n\n// One-shot: just the 32-byte root\nconst rootHash = root(data)\n\n// One-shot: full multihash digest with metadata\nconst result = digest(data)\n\n// Streaming: for large files\nconst hasher = create()\nfor (const chunk of chunks) {\n  hasher.write(chunk)\n}\nconst streamResult = hasher.digest()\nhasher.free() // Free WASM memory when done\n```\n\n## Content-Security-Policy\n\nIn browsers, a page whose Content-Security-Policy sets `script-src` must allow `'wasm-unsafe-eval'` for hashing to work:\n\n```\nContent-Security-Policy: script-src 'self' 'wasm-unsafe-eval'\n```\n\nWithout it, importing still works, but the first hash throws an error that names the missing directive, with the browser's `CompileError` as its `cause`.\n\n## Cloudflare Workers\n\nworkerd only compiles WebAssembly from bytes while a Worker starts up, so the inline base64 can't be used when the package is evaluated later (a dynamic import, a lazily loaded route chunk, or `@cloudflare/vitest-plugin`). For workerd the package exports an entry, under the `workerd` condition, that imports `commp_bg.wasm` instead. Wrangler, `@cloudflare/vite-plugin` and `@cloudflare/vitest-plugin` pick it up and compile the `.wasm` ahead of time, so no configuration is needed.\n\nSee the [repository README](https://github.com/hugomrdias/commp#readme) for the full API and benchmarks.\n\n## License\n\nMIT\n","readmeFilename":""}