diff --git a/.changeset/mighty-laws-suffer.md b/.changeset/mighty-laws-suffer.md new file mode 100644 index 00000000..58d65e3b --- /dev/null +++ b/.changeset/mighty-laws-suffer.md @@ -0,0 +1,5 @@ +--- +'@bnb-chain/reed-solomon': minor +--- + +feat: Clean InjectWorker diff --git a/.changeset/tidy-boats-laugh.md b/.changeset/tidy-boats-laugh.md new file mode 100644 index 00000000..2a5e6476 --- /dev/null +++ b/.changeset/tidy-boats-laugh.md @@ -0,0 +1,5 @@ +--- +'@bnb-chain/reed-solomon': minor +--- + +feat: Support setting worker counts diff --git a/packages/reed-solomon/README.md b/packages/reed-solomon/README.md index c62133d1..ef9ca2be 100644 --- a/packages/reed-solomon/README.md +++ b/packages/reed-solomon/README.md @@ -33,7 +33,6 @@ Use directly in the browser via script tag: get reed solomon - @@ -128,6 +122,6 @@ const res = await rs.encodeInWorker(__filename, Uint8Array.from(fileBuffer)) [Code](./examples/node-worker.js) -## Benchark +## Benchmark [benchmark](./benchmark.md) diff --git a/packages/reed-solomon/examples/node.js b/packages/reed-solomon/examples/node.js index 372739bb..156e70f1 100644 --- a/packages/reed-solomon/examples/node.js +++ b/packages/reed-solomon/examples/node.js @@ -3,13 +3,13 @@ const fs = require('node:fs'); const path = require('node:path'); const { ReedSolomon } = require('../dist/index'); -const fileBuffer = fs.readFileSync('./README.md'); +const sourceData = fs.readFileSync('./README.md'); (async () => { const rs = new ReedSolomon(); console.log('file size', sourceData.length / 1024 / 1024, 'm'); console.time('cost'); - const res = await rs.encode(Uint8Array.from(fileBuffer)); + const res = await rs.encode(Uint8Array.from(sourceData)); console.log('res', res); console.timeEnd('cost'); })(); diff --git a/packages/reed-solomon/examples/web-worker.html b/packages/reed-solomon/examples/web-worker.html index eadede31..71989c9c 100644 --- a/packages/reed-solomon/examples/web-worker.html +++ b/packages/reed-solomon/examples/web-worker.html @@ -17,6 +17,12 @@