From 329faaa8b2216c0f70330e940f928958a8182758 Mon Sep 17 00:00:00 2001 From: rk <59029880+rrr523@users.noreply.github.com> Date: Sat, 23 Dec 2023 16:30:43 +0800 Subject: [PATCH] docs: Update rs umd way (#457) --- .../docs/FAQs/caclute-checksum-is-slow.mdx | 107 ++++++++++++------ examples/nodejs/cases/storage.js | 6 - 2 files changed, 74 insertions(+), 39 deletions(-) diff --git a/doc-site/docs/FAQs/caclute-checksum-is-slow.mdx b/doc-site/docs/FAQs/caclute-checksum-is-slow.mdx index 9ea5da86..050f720a 100644 --- a/doc-site/docs/FAQs/caclute-checksum-is-slow.mdx +++ b/doc-site/docs/FAQs/caclute-checksum-is-slow.mdx @@ -33,7 +33,7 @@ You can use core lib directly in the browser and Nodejs, or you can use us to ru When you are developing Greenfield and need to create objects, if you are sure that the files are small (maybe less than 5m or 10m), you can directly use the ESM solution: -```javascript title="core lib" +```javascript title="core lib (ESM)" import {ReedSolomon} from '@bnb-chain/reed-solomon' const rs = new RS.ReedSolomon(); @@ -42,42 +42,83 @@ const res = rs.encode(new Uint8Array(fileBuffer)) If the file is larger, this method may cause the page to freeze when calculating. In this case, we recommend using the worker mode: -```html title="web worker" +```html title="core lib (UMD)" + + + + +
+ + + + +``` + +```html title="web worker (only support UMD)" - + + + + + + + + ``` diff --git a/examples/nodejs/cases/storage.js b/examples/nodejs/cases/storage.js index d2ccf954..0660b70c 100644 --- a/examples/nodejs/cases/storage.js +++ b/examples/nodejs/cases/storage.js @@ -32,9 +32,6 @@ console.log('objectName', objectName); primarySpAddress: spInfo.primarySpAddress, }, paymentAddress: ACCOUNT_ADDRESS, - tags: { - tags: [], - }, }, { type: 'ECDSA', @@ -72,9 +69,6 @@ console.log('objectName', objectName); redundancyType: 'REDUNDANCY_EC_TYPE', contentLength: fileBuffer.length, expectCheckSums, - tags: { - tags: [], - }, }, { type: 'ECDSA',