@fireproof/vendor 0.0.0-smoke
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +29 -0
- package/patched/@ipld/dag-json/.github/dependabot.yml +11 -0
- package/patched/@ipld/dag-json/.github/workflows/js-test-and-release.yml +28 -0
- package/patched/@ipld/dag-json/CHANGELOG.md +202 -0
- package/patched/@ipld/dag-json/LICENSE +4 -0
- package/patched/@ipld/dag-json/LICENSE-APACHE +5 -0
- package/patched/@ipld/dag-json/LICENSE-MIT +19 -0
- package/patched/@ipld/dag-json/README.md +58 -0
- package/patched/@ipld/dag-json/ipld-dag-json-10.2.3.tgz +0 -0
- package/patched/@ipld/dag-json/package.json +173 -0
- package/patched/@ipld/dag-json/src/index.js +291 -0
- package/patched/@ipld/dag-json/test/test-basics.spec.js +290 -0
- package/patched/@ipld/dag-json/test/ts-use/package.json +11 -0
- package/patched/@ipld/dag-json/test/ts-use/src/main.ts +54 -0
- package/patched/@ipld/dag-json/test/ts-use/tsconfig.json +9 -0
- package/patched/@ipld/dag-json/tsconfig.json +14 -0
- package/patched/cborg/.github/dependabot.yml +16 -0
- package/patched/cborg/.github/workflows/test-and-release.yml +52 -0
- package/patched/cborg/CHANGELOG.md +513 -0
- package/patched/cborg/LICENSE +13 -0
- package/patched/cborg/README.md +515 -0
- package/patched/cborg/bench/bench.js +117 -0
- package/patched/cborg/bench/json.js +124 -0
- package/patched/cborg/bench/package.json +8 -0
- package/patched/cborg/cborg-4.2.7.tgz +0 -0
- package/patched/cborg/cborg.js +31 -0
- package/patched/cborg/example-bytestrings.js +180 -0
- package/patched/cborg/example-json.js +6 -0
- package/patched/cborg/example.js +5 -0
- package/patched/cborg/interface.ts +56 -0
- package/patched/cborg/lib/0uint.js +227 -0
- package/patched/cborg/lib/1negint.js +111 -0
- package/patched/cborg/lib/2bytes.js +133 -0
- package/patched/cborg/lib/3string.js +90 -0
- package/patched/cborg/lib/4array.js +113 -0
- package/patched/cborg/lib/5map.js +113 -0
- package/patched/cborg/lib/6tag.js +80 -0
- package/patched/cborg/lib/7float.js +308 -0
- package/patched/cborg/lib/bin.js +189 -0
- package/patched/cborg/lib/bl.js +124 -0
- package/patched/cborg/lib/byte-utils.js +417 -0
- package/patched/cborg/lib/common.js +27 -0
- package/patched/cborg/lib/decode.js +209 -0
- package/patched/cborg/lib/diagnostic.js +156 -0
- package/patched/cborg/lib/diagnostic_test.js +117 -0
- package/patched/cborg/lib/encode.js +464 -0
- package/patched/cborg/lib/is.js +106 -0
- package/patched/cborg/lib/json/decode.js +462 -0
- package/patched/cborg/lib/json/encode.js +299 -0
- package/patched/cborg/lib/json/json.js +4 -0
- package/patched/cborg/lib/jump.js +209 -0
- package/patched/cborg/lib/length.js +61 -0
- package/patched/cborg/lib/token.js +76 -0
- package/patched/cborg/package.json +169 -0
- package/patched/cborg/pnpm-lock.yaml +6096 -0
- package/patched/cborg/taglib.js +73 -0
- package/patched/cborg/test/appendix_a.js +647 -0
- package/patched/cborg/test/common.js +18 -0
- package/patched/cborg/test/node-test-bin.js +402 -0
- package/patched/cborg/test/noop-bin-test.js +3 -0
- package/patched/cborg/test/test-0uint.js +103 -0
- package/patched/cborg/test/test-1negint.js +96 -0
- package/patched/cborg/test/test-2bytes.js +198 -0
- package/patched/cborg/test/test-3string.js +136 -0
- package/patched/cborg/test/test-4array.js +93 -0
- package/patched/cborg/test/test-5map.js +284 -0
- package/patched/cborg/test/test-6tag.js +85 -0
- package/patched/cborg/test/test-7float.js +131 -0
- package/patched/cborg/test/test-bl.js +37 -0
- package/patched/cborg/test/test-cbor-vectors.js +107 -0
- package/patched/cborg/test/test-decode-errors.js +65 -0
- package/patched/cborg/test/test-fuzz.js +42 -0
- package/patched/cborg/test/test-json.js +219 -0
- package/patched/cborg/test/test-length.js +65 -0
- package/patched/cborg/test/test-partial.js +111 -0
- package/patched/cborg/tsconfig.json +45 -0
- package/patched/cborg/types/cborg.d.ts +28 -0
- package/patched/cborg/types/cborg.d.ts.map +1 -0
- package/patched/cborg/types/example.d.ts +2 -0
- package/patched/cborg/types/example.d.ts.map +1 -0
- package/patched/cborg/types/interface.d.ts +47 -0
- package/patched/cborg/types/interface.d.ts.map +1 -0
- package/patched/cborg/types/lib/0uint.d.ts +100 -0
- package/patched/cborg/types/lib/0uint.d.ts.map +1 -0
- package/patched/cborg/types/lib/1negint.d.ts +58 -0
- package/patched/cborg/types/lib/1negint.d.ts.map +1 -0
- package/patched/cborg/types/lib/2bytes.d.ts +68 -0
- package/patched/cborg/types/lib/2bytes.d.ts.map +1 -0
- package/patched/cborg/types/lib/3string.d.ts +46 -0
- package/patched/cborg/types/lib/3string.d.ts.map +1 -0
- package/patched/cborg/types/lib/4array.d.ts +65 -0
- package/patched/cborg/types/lib/4array.d.ts.map +1 -0
- package/patched/cborg/types/lib/5map.d.ts +65 -0
- package/patched/cborg/types/lib/5map.d.ts.map +1 -0
- package/patched/cborg/types/lib/6tag.d.ts +61 -0
- package/patched/cborg/types/lib/6tag.d.ts.map +1 -0
- package/patched/cborg/types/lib/7float.d.ts +60 -0
- package/patched/cborg/types/lib/7float.d.ts.map +1 -0
- package/patched/cborg/types/lib/bin.d.ts +4 -0
- package/patched/cborg/types/lib/bin.d.ts.map +1 -0
- package/patched/cborg/types/lib/bl.d.ts +26 -0
- package/patched/cborg/types/lib/bl.d.ts.map +1 -0
- package/patched/cborg/types/lib/byte-utils.d.ts +53 -0
- package/patched/cborg/types/lib/byte-utils.d.ts.map +1 -0
- package/patched/cborg/types/lib/common.d.ts +10 -0
- package/patched/cborg/types/lib/common.d.ts.map +1 -0
- package/patched/cborg/types/lib/decode.d.ts +41 -0
- package/patched/cborg/types/lib/decode.d.ts.map +1 -0
- package/patched/cborg/types/lib/diagnostic.d.ts +12 -0
- package/patched/cborg/types/lib/diagnostic.d.ts.map +1 -0
- package/patched/cborg/types/lib/diagnostic_test.d.ts +2 -0
- package/patched/cborg/types/lib/diagnostic_test.d.ts.map +1 -0
- package/patched/cborg/types/lib/encode.d.ts +50 -0
- package/patched/cborg/types/lib/encode.d.ts.map +1 -0
- package/patched/cborg/types/lib/is.d.ts +6 -0
- package/patched/cborg/types/lib/is.d.ts.map +1 -0
- package/patched/cborg/types/lib/json/decode.d.ts +67 -0
- package/patched/cborg/types/lib/json/decode.d.ts.map +1 -0
- package/patched/cborg/types/lib/json/encode.d.ts +11 -0
- package/patched/cborg/types/lib/json/encode.d.ts.map +1 -0
- package/patched/cborg/types/lib/json/forward-cborg.d.ts +6 -0
- package/patched/cborg/types/lib/json/forward-cborg.d.ts.map +1 -0
- package/patched/cborg/types/lib/json/json.d.ts +6 -0
- package/patched/cborg/types/lib/json/json.d.ts.map +1 -0
- package/patched/cborg/types/lib/jump.d.ts +12 -0
- package/patched/cborg/types/lib/jump.d.ts.map +1 -0
- package/patched/cborg/types/lib/length.d.ts +27 -0
- package/patched/cborg/types/lib/length.d.ts.map +1 -0
- package/patched/cborg/types/lib/token.d.ts +59 -0
- package/patched/cborg/types/lib/token.d.ts.map +1 -0
- package/patched/cborg/types/taglib.d.ts +18 -0
- package/patched/cborg/types/taglib.d.ts.map +1 -0
- package/patched/cborg/types/tsconfig.tsbuildinfo +1 -0
- package/src/@ipld/car/car/LICENSE +4 -0
- package/src/@ipld/car/car/README.md +1078 -0
- package/src/@ipld/car/car/dist/index.min.js +5 -0
- package/src/@ipld/car/car/dist/src/api.d.ts +72 -0
- package/src/@ipld/car/car/dist/src/api.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/buffer-decoder.d.ts +67 -0
- package/src/@ipld/car/car/dist/src/buffer-decoder.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/buffer-reader-browser.d.ts +116 -0
- package/src/@ipld/car/car/dist/src/buffer-reader-browser.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/buffer-reader.d.ts +31 -0
- package/src/@ipld/car/car/dist/src/buffer-reader.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/buffer-writer.d.ts +86 -0
- package/src/@ipld/car/car/dist/src/buffer-writer.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/coding.d.ts +49 -0
- package/src/@ipld/car/car/dist/src/coding.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/decoder-common.d.ts +43 -0
- package/src/@ipld/car/car/dist/src/decoder-common.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/decoder.d.ts +87 -0
- package/src/@ipld/car/car/dist/src/decoder.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/encoder.d.ts +17 -0
- package/src/@ipld/car/car/dist/src/encoder.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/header-validator.d.ts +5 -0
- package/src/@ipld/car/car/dist/src/header-validator.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/index-browser.d.ts +10 -0
- package/src/@ipld/car/car/dist/src/index-browser.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/index.d.ts +11 -0
- package/src/@ipld/car/car/dist/src/index.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/indexed-reader-browser.d.ts +5 -0
- package/src/@ipld/car/car/dist/src/indexed-reader-browser.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/indexed-reader.d.ts +152 -0
- package/src/@ipld/car/car/dist/src/indexed-reader.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/indexer.d.ts +95 -0
- package/src/@ipld/car/car/dist/src/indexer.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/iterator-channel.d.ts +7 -0
- package/src/@ipld/car/car/dist/src/iterator-channel.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/iterator.d.ts +174 -0
- package/src/@ipld/car/car/dist/src/iterator.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/reader-browser.d.ts +151 -0
- package/src/@ipld/car/car/dist/src/reader-browser.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/reader.d.ts +35 -0
- package/src/@ipld/car/car/dist/src/reader.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/writer-browser.d.ts +155 -0
- package/src/@ipld/car/car/dist/src/writer-browser.d.ts.map +1 -0
- package/src/@ipld/car/car/dist/src/writer.d.ts +45 -0
- package/src/@ipld/car/car/dist/src/writer.d.ts.map +1 -0
- package/src/@ipld/car/car/node_modules/.bin/cborg +17 -0
- package/src/@ipld/car/car/package.json +235 -0
- package/src/@ipld/car/car/src/api.ts +90 -0
- package/src/@ipld/car/car/src/buffer-decoder.js +213 -0
- package/src/@ipld/car/car/src/buffer-reader-browser.js +144 -0
- package/src/@ipld/car/car/src/buffer-reader.js +51 -0
- package/src/@ipld/car/car/src/buffer-writer.js +286 -0
- package/src/@ipld/car/car/src/coding.ts +68 -0
- package/src/@ipld/car/car/src/decoder-common.js +82 -0
- package/src/@ipld/car/car/src/decoder.js +347 -0
- package/src/@ipld/car/car/src/encoder.js +76 -0
- package/src/@ipld/car/car/src/header-validator.js +214 -0
- package/src/@ipld/car/car/src/header.ipldsch +18 -0
- package/src/@ipld/car/car/src/index-browser.js +18 -0
- package/src/@ipld/car/car/src/index.js +21 -0
- package/src/@ipld/car/car/src/indexed-reader-browser.js +7 -0
- package/src/@ipld/car/car/src/indexed-reader.js +211 -0
- package/src/@ipld/car/car/src/indexer.js +130 -0
- package/src/@ipld/car/car/src/iterator-channel.js +91 -0
- package/src/@ipld/car/car/src/iterator.js +267 -0
- package/src/@ipld/car/car/src/reader-browser.js +194 -0
- package/src/@ipld/car/car/src/reader.js +56 -0
- package/src/@ipld/car/car/src/writer-browser.js +250 -0
- package/src/@ipld/car/car/src/writer.js +84 -0
- package/src/@ipld/dag-cbor/dag-cbor/LICENSE +4 -0
- package/src/@ipld/dag-cbor/dag-cbor/README.md +80 -0
- package/src/@ipld/dag-cbor/dag-cbor/dist/index.min.js +3 -0
- package/src/@ipld/dag-cbor/dag-cbor/dist/src/index.d.ts +67 -0
- package/src/@ipld/dag-cbor/dag-cbor/dist/src/index.d.ts.map +1 -0
- package/src/@ipld/dag-cbor/dag-cbor/node_modules/.bin/cborg +17 -0
- package/src/@ipld/dag-cbor/dag-cbor/package.json +171 -0
- package/src/@ipld/dag-cbor/dag-cbor/src/index.js +147 -0
- package/src/@ipld/dag-json/dag-json/LICENSE +4 -0
- package/src/@ipld/dag-json/dag-json/README.md +58 -0
- package/src/@ipld/dag-json/dag-json/dist/index.min.js +3 -0
- package/src/@ipld/dag-json/dag-json/dist/src/index.d.ts +12 -0
- package/src/@ipld/dag-json/dag-json/dist/src/index.d.ts.map +1 -0
- package/src/@ipld/dag-json/dag-json/node_modules/.bin/cborg +17 -0
- package/src/@ipld/dag-json/dag-json/package.json +173 -0
- package/src/@ipld/dag-json/dag-json/src/index.js +291 -0
- package/src/@web3-storage/pail/pail/LICENSE.md +232 -0
- package/src/@web3-storage/pail/pail/README.md +84 -0
- package/src/@web3-storage/pail/pail/cli.js +218 -0
- package/src/@web3-storage/pail/pail/dist/src/api.d.ts +59 -0
- package/src/@web3-storage/pail/pail/dist/src/api.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/batch/api.d.ts +31 -0
- package/src/@web3-storage/pail/pail/dist/src/batch/api.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/batch/index.d.ts +75 -0
- package/src/@web3-storage/pail/pail/dist/src/batch/index.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/batch/shard.d.ts +3 -0
- package/src/@web3-storage/pail/pail/dist/src/batch/shard.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/block.d.ts +35 -0
- package/src/@web3-storage/pail/pail/dist/src/block.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/clock/api.d.ts +10 -0
- package/src/@web3-storage/pail/pail/dist/src/clock/api.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/clock/index.d.ts +48 -0
- package/src/@web3-storage/pail/pail/dist/src/clock/index.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/crdt/api.d.ts +26 -0
- package/src/@web3-storage/pail/pail/dist/src/crdt/api.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/api.d.ts +11 -0
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/api.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/index.d.ts +5 -0
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/index.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/crdt/index.d.ts +9 -0
- package/src/@web3-storage/pail/pail/dist/src/crdt/index.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/diff.d.ts +13 -0
- package/src/@web3-storage/pail/pail/dist/src/diff.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/index.d.ts +10 -0
- package/src/@web3-storage/pail/pail/dist/src/index.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/merge.d.ts +5 -0
- package/src/@web3-storage/pail/pail/dist/src/merge.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/src/shard.d.ts +43 -0
- package/src/@web3-storage/pail/pail/dist/src/shard.d.ts.map +1 -0
- package/src/@web3-storage/pail/pail/dist/tsconfig.tsbuildinfo +1 -0
- package/src/@web3-storage/pail/pail/node_modules/.bin/pail +17 -0
- package/src/@web3-storage/pail/pail/package.json +173 -0
- package/src/@web3-storage/pail/pail/src/api.js +1 -0
- package/src/@web3-storage/pail/pail/src/api.ts +90 -0
- package/src/@web3-storage/pail/pail/src/batch/api.js +1 -0
- package/src/@web3-storage/pail/pail/src/batch/api.ts +59 -0
- package/src/@web3-storage/pail/pail/src/batch/index.js +258 -0
- package/src/@web3-storage/pail/pail/src/batch/shard.js +13 -0
- package/src/@web3-storage/pail/pail/src/block.js +75 -0
- package/src/@web3-storage/pail/pail/src/clock/api.js +1 -0
- package/src/@web3-storage/pail/pail/src/clock/api.ts +12 -0
- package/src/@web3-storage/pail/pail/src/clock/index.js +182 -0
- package/src/@web3-storage/pail/pail/src/crdt/api.js +1 -0
- package/src/@web3-storage/pail/pail/src/crdt/api.ts +33 -0
- package/src/@web3-storage/pail/pail/src/crdt/batch/api.js +1 -0
- package/src/@web3-storage/pail/pail/src/crdt/batch/api.ts +30 -0
- package/src/@web3-storage/pail/pail/src/crdt/batch/index.js +155 -0
- package/src/@web3-storage/pail/pail/src/crdt/index.js +354 -0
- package/src/@web3-storage/pail/pail/src/diff.js +151 -0
- package/src/@web3-storage/pail/pail/src/index.js +406 -0
- package/src/@web3-storage/pail/pail/src/merge.js +43 -0
- package/src/@web3-storage/pail/pail/src/shard.js +180 -0
- package/src/cborg/cborg/.github/dependabot.yml +16 -0
- package/src/cborg/cborg/.github/workflows/test-and-release.yml +52 -0
- package/src/cborg/cborg/CHANGELOG.md +513 -0
- package/src/cborg/cborg/LICENSE +13 -0
- package/src/cborg/cborg/README.md +515 -0
- package/src/cborg/cborg/bench/bench.js +117 -0
- package/src/cborg/cborg/bench/json.js +124 -0
- package/src/cborg/cborg/bench/package.json +8 -0
- package/src/cborg/cborg/cborg.js +31 -0
- package/src/cborg/cborg/example-bytestrings.js +180 -0
- package/src/cborg/cborg/example-json.js +6 -0
- package/src/cborg/cborg/example.js +5 -0
- package/src/cborg/cborg/interface.ts +56 -0
- package/src/cborg/cborg/lib/0uint.js +227 -0
- package/src/cborg/cborg/lib/1negint.js +111 -0
- package/src/cborg/cborg/lib/2bytes.js +133 -0
- package/src/cborg/cborg/lib/3string.js +90 -0
- package/src/cborg/cborg/lib/4array.js +113 -0
- package/src/cborg/cborg/lib/5map.js +113 -0
- package/src/cborg/cborg/lib/6tag.js +80 -0
- package/src/cborg/cborg/lib/7float.js +308 -0
- package/src/cborg/cborg/lib/bin.js +189 -0
- package/src/cborg/cborg/lib/bl.js +124 -0
- package/src/cborg/cborg/lib/byte-utils.js +417 -0
- package/src/cborg/cborg/lib/common.js +27 -0
- package/src/cborg/cborg/lib/decode.js +209 -0
- package/src/cborg/cborg/lib/diagnostic.js +156 -0
- package/src/cborg/cborg/lib/diagnostic_test.js +117 -0
- package/src/cborg/cborg/lib/encode.js +464 -0
- package/src/cborg/cborg/lib/is.js +106 -0
- package/src/cborg/cborg/lib/json/decode.js +462 -0
- package/src/cborg/cborg/lib/json/encode.js +299 -0
- package/src/cborg/cborg/lib/json/json.js +4 -0
- package/src/cborg/cborg/lib/jump.js +209 -0
- package/src/cborg/cborg/lib/length.js +61 -0
- package/src/cborg/cborg/lib/token.js +76 -0
- package/src/cborg/cborg/node_modules/.bin/cborg +17 -0
- package/src/cborg/cborg/package.json +168 -0
- package/src/cborg/cborg/taglib.js +73 -0
- package/src/cborg/cborg/test/appendix_a.js +647 -0
- package/src/cborg/cborg/test/common.js +18 -0
- package/src/cborg/cborg/test/node-test-bin.js +402 -0
- package/src/cborg/cborg/test/noop-bin-test.js +3 -0
- package/src/cborg/cborg/test/test-0uint.js +103 -0
- package/src/cborg/cborg/test/test-1negint.js +96 -0
- package/src/cborg/cborg/test/test-2bytes.js +198 -0
- package/src/cborg/cborg/test/test-3string.js +136 -0
- package/src/cborg/cborg/test/test-4array.js +93 -0
- package/src/cborg/cborg/test/test-5map.js +284 -0
- package/src/cborg/cborg/test/test-6tag.js +85 -0
- package/src/cborg/cborg/test/test-7float.js +131 -0
- package/src/cborg/cborg/test/test-bl.js +37 -0
- package/src/cborg/cborg/test/test-cbor-vectors.js +107 -0
- package/src/cborg/cborg/test/test-decode-errors.js +65 -0
- package/src/cborg/cborg/test/test-fuzz.js +42 -0
- package/src/cborg/cborg/test/test-json.js +219 -0
- package/src/cborg/cborg/test/test-length.js +65 -0
- package/src/cborg/cborg/test/test-partial.js +111 -0
- package/src/cborg/cborg/tsconfig.json +45 -0
- package/src/cborg/cborg/types/cborg.d.ts +28 -0
- package/src/cborg/cborg/types/cborg.d.ts.map +1 -0
- package/src/cborg/cborg/types/example.d.ts +2 -0
- package/src/cborg/cborg/types/example.d.ts.map +1 -0
- package/src/cborg/cborg/types/interface.d.ts +47 -0
- package/src/cborg/cborg/types/interface.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/0uint.d.ts +100 -0
- package/src/cborg/cborg/types/lib/0uint.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/1negint.d.ts +58 -0
- package/src/cborg/cborg/types/lib/1negint.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/2bytes.d.ts +68 -0
- package/src/cborg/cborg/types/lib/2bytes.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/3string.d.ts +46 -0
- package/src/cborg/cborg/types/lib/3string.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/4array.d.ts +65 -0
- package/src/cborg/cborg/types/lib/4array.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/5map.d.ts +65 -0
- package/src/cborg/cborg/types/lib/5map.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/6tag.d.ts +61 -0
- package/src/cborg/cborg/types/lib/6tag.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/7float.d.ts +60 -0
- package/src/cborg/cborg/types/lib/7float.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/bin.d.ts +4 -0
- package/src/cborg/cborg/types/lib/bin.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/bl.d.ts +26 -0
- package/src/cborg/cborg/types/lib/bl.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/byte-utils.d.ts +53 -0
- package/src/cborg/cborg/types/lib/byte-utils.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/common.d.ts +10 -0
- package/src/cborg/cborg/types/lib/common.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/decode.d.ts +41 -0
- package/src/cborg/cborg/types/lib/decode.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/diagnostic.d.ts +12 -0
- package/src/cborg/cborg/types/lib/diagnostic.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/diagnostic_test.d.ts +2 -0
- package/src/cborg/cborg/types/lib/diagnostic_test.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/encode.d.ts +50 -0
- package/src/cborg/cborg/types/lib/encode.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/is.d.ts +6 -0
- package/src/cborg/cborg/types/lib/is.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/json/decode.d.ts +67 -0
- package/src/cborg/cborg/types/lib/json/decode.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/json/encode.d.ts +11 -0
- package/src/cborg/cborg/types/lib/json/encode.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/json/forward-cborg.d.ts +6 -0
- package/src/cborg/cborg/types/lib/json/forward-cborg.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/json/json.d.ts +6 -0
- package/src/cborg/cborg/types/lib/json/json.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/jump.d.ts +12 -0
- package/src/cborg/cborg/types/lib/jump.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/length.d.ts +27 -0
- package/src/cborg/cborg/types/lib/length.d.ts.map +1 -0
- package/src/cborg/cborg/types/lib/token.d.ts +59 -0
- package/src/cborg/cborg/types/lib/token.d.ts.map +1 -0
- package/src/cborg/cborg/types/taglib.d.ts +18 -0
- package/src/cborg/cborg/types/taglib.d.ts.map +1 -0
- package/src/cborg/cborg/types/tsconfig.tsbuildinfo +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/LICENSE +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/README.md +105 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/index.min.js +3 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.d.ts +57 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.js +73 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.d.ts +355 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.js +197 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js +9 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js +9 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.js +38 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.js +30 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.js +9 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.js +37 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js +29 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js +153 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js +59 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js +25 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js +104 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts +3 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js +20 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts +6 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js +116 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts +4 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js +57 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts +6 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js +30 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js.map +1 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/typedoc-urls.json +58 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/package.json +180 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/errors.ts +87 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/index.ts +498 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/dag-cbor.ts +12 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/dag-json.ts +12 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/identity.ts +49 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/index.ts +35 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/json.ts +12 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/raw.ts +49 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/directory.ts +39 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.ts +198 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/hamt-sharded-directory.ts +76 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/raw.ts +37 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/index.ts +121 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/extract-data-from-block.ts +24 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.ts +149 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/resolve-object-path.ts +62 -0
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/validate-offset-and-length.ts +38 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* eslint-env es2020 */
|
|
2
|
+
|
|
3
|
+
import { Token, Type } from './token.js'
|
|
4
|
+
import * as uint from './0uint.js'
|
|
5
|
+
import { decodeErrPrefix } from './common.js'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import('./bl.js').Bl} Bl
|
|
9
|
+
* @typedef {import('../interface').DecodeOptions} DecodeOptions
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {Uint8Array} data
|
|
14
|
+
* @param {number} pos
|
|
15
|
+
* @param {number} _minor
|
|
16
|
+
* @param {DecodeOptions} options
|
|
17
|
+
* @returns {Token}
|
|
18
|
+
*/
|
|
19
|
+
export function decodeNegint8 (data, pos, _minor, options) {
|
|
20
|
+
return new Token(Type.negint, -1 - uint.readUint8(data, pos + 1, options), 2)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {Uint8Array} data
|
|
25
|
+
* @param {number} pos
|
|
26
|
+
* @param {number} _minor
|
|
27
|
+
* @param {DecodeOptions} options
|
|
28
|
+
* @returns {Token}
|
|
29
|
+
*/
|
|
30
|
+
export function decodeNegint16 (data, pos, _minor, options) {
|
|
31
|
+
return new Token(Type.negint, -1 - uint.readUint16(data, pos + 1, options), 3)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param {Uint8Array} data
|
|
36
|
+
* @param {number} pos
|
|
37
|
+
* @param {number} _minor
|
|
38
|
+
* @param {DecodeOptions} options
|
|
39
|
+
* @returns {Token}
|
|
40
|
+
*/
|
|
41
|
+
export function decodeNegint32 (data, pos, _minor, options) {
|
|
42
|
+
return new Token(Type.negint, -1 - uint.readUint32(data, pos + 1, options), 5)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const neg1b = BigInt(-1)
|
|
46
|
+
const pos1b = BigInt(1)
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @param {Uint8Array} data
|
|
50
|
+
* @param {number} pos
|
|
51
|
+
* @param {number} _minor
|
|
52
|
+
* @param {DecodeOptions} options
|
|
53
|
+
* @returns {Token}
|
|
54
|
+
*/
|
|
55
|
+
export function decodeNegint64 (data, pos, _minor, options) {
|
|
56
|
+
const int = uint.readUint64(data, pos + 1, options)
|
|
57
|
+
if (typeof int !== 'bigint') {
|
|
58
|
+
const value = -1 - int
|
|
59
|
+
if (value >= Number.MIN_SAFE_INTEGER) {
|
|
60
|
+
return new Token(Type.negint, value, 9)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (options.allowBigInt !== true) {
|
|
64
|
+
throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`)
|
|
65
|
+
}
|
|
66
|
+
return new Token(Type.negint, neg1b - BigInt(int), 9)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param {Bl} buf
|
|
71
|
+
* @param {Token} token
|
|
72
|
+
*/
|
|
73
|
+
export function encodeNegint (buf, token) {
|
|
74
|
+
const negint = token.value
|
|
75
|
+
const unsigned = (typeof negint === 'bigint' ? (negint * neg1b - pos1b) : (negint * -1 - 1))
|
|
76
|
+
uint.encodeUintValue(buf, token.type.majorEncoded, unsigned)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @param {Token} token
|
|
81
|
+
* @returns {number}
|
|
82
|
+
*/
|
|
83
|
+
encodeNegint.encodedSize = function encodedSize (token) {
|
|
84
|
+
const negint = token.value
|
|
85
|
+
const unsigned = (typeof negint === 'bigint' ? (negint * neg1b - pos1b) : (negint * -1 - 1))
|
|
86
|
+
/* c8 ignore next 4 */
|
|
87
|
+
// handled by quickEncode, we shouldn't get here but it's included for completeness
|
|
88
|
+
if (unsigned < uint.uintBoundaries[0]) {
|
|
89
|
+
return 1
|
|
90
|
+
}
|
|
91
|
+
if (unsigned < uint.uintBoundaries[1]) {
|
|
92
|
+
return 2
|
|
93
|
+
}
|
|
94
|
+
if (unsigned < uint.uintBoundaries[2]) {
|
|
95
|
+
return 3
|
|
96
|
+
}
|
|
97
|
+
if (unsigned < uint.uintBoundaries[3]) {
|
|
98
|
+
return 5
|
|
99
|
+
}
|
|
100
|
+
return 9
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @param {Token} tok1
|
|
105
|
+
* @param {Token} tok2
|
|
106
|
+
* @returns {number}
|
|
107
|
+
*/
|
|
108
|
+
encodeNegint.compareTokens = function compareTokens (tok1, tok2) {
|
|
109
|
+
// opposite of the uint comparison since we store the uint version in bytes
|
|
110
|
+
return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : /* c8 ignore next */ 0
|
|
111
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Token, Type } from './token.js'
|
|
2
|
+
import { assertEnoughData, decodeErrPrefix } from './common.js'
|
|
3
|
+
import * as uint from './0uint.js'
|
|
4
|
+
import { compare, fromString, slice } from './byte-utils.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {import('./bl.js').Bl} Bl
|
|
8
|
+
* @typedef {import('../interface').DecodeOptions} DecodeOptions
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {Uint8Array} data
|
|
13
|
+
* @param {number} pos
|
|
14
|
+
* @param {number} prefix
|
|
15
|
+
* @param {number} length
|
|
16
|
+
* @returns {Token}
|
|
17
|
+
*/
|
|
18
|
+
function toToken (data, pos, prefix, length) {
|
|
19
|
+
assertEnoughData(data, pos, prefix + length)
|
|
20
|
+
const buf = slice(data, pos + prefix, pos + prefix + length)
|
|
21
|
+
return new Token(Type.bytes, buf, prefix + length)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {Uint8Array} data
|
|
26
|
+
* @param {number} pos
|
|
27
|
+
* @param {number} minor
|
|
28
|
+
* @param {DecodeOptions} _options
|
|
29
|
+
* @returns {Token}
|
|
30
|
+
*/
|
|
31
|
+
export function decodeBytesCompact (data, pos, minor, _options) {
|
|
32
|
+
return toToken(data, pos, 1, minor)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {Uint8Array} data
|
|
37
|
+
* @param {number} pos
|
|
38
|
+
* @param {number} _minor
|
|
39
|
+
* @param {DecodeOptions} options
|
|
40
|
+
* @returns {Token}
|
|
41
|
+
*/
|
|
42
|
+
export function decodeBytes8 (data, pos, _minor, options) {
|
|
43
|
+
return toToken(data, pos, 2, uint.readUint8(data, pos + 1, options))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param {Uint8Array} data
|
|
48
|
+
* @param {number} pos
|
|
49
|
+
* @param {number} _minor
|
|
50
|
+
* @param {DecodeOptions} options
|
|
51
|
+
* @returns {Token}
|
|
52
|
+
*/
|
|
53
|
+
export function decodeBytes16 (data, pos, _minor, options) {
|
|
54
|
+
return toToken(data, pos, 3, uint.readUint16(data, pos + 1, options))
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @param {Uint8Array} data
|
|
59
|
+
* @param {number} pos
|
|
60
|
+
* @param {number} _minor
|
|
61
|
+
* @param {DecodeOptions} options
|
|
62
|
+
* @returns {Token}
|
|
63
|
+
*/
|
|
64
|
+
export function decodeBytes32 (data, pos, _minor, options) {
|
|
65
|
+
return toToken(data, pos, 5, uint.readUint32(data, pos + 1, options))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// TODO: maybe we shouldn't support this ..
|
|
69
|
+
/**
|
|
70
|
+
* @param {Uint8Array} data
|
|
71
|
+
* @param {number} pos
|
|
72
|
+
* @param {number} _minor
|
|
73
|
+
* @param {DecodeOptions} options
|
|
74
|
+
* @returns {Token}
|
|
75
|
+
*/
|
|
76
|
+
export function decodeBytes64 (data, pos, _minor, options) {
|
|
77
|
+
const l = uint.readUint64(data, pos + 1, options)
|
|
78
|
+
if (typeof l === 'bigint') {
|
|
79
|
+
throw new Error(`${decodeErrPrefix} 64-bit integer bytes lengths not supported`)
|
|
80
|
+
}
|
|
81
|
+
return toToken(data, pos, 9, l)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* `encodedBytes` allows for caching when we do a byte version of a string
|
|
86
|
+
* for key sorting purposes
|
|
87
|
+
* @param {Token} token
|
|
88
|
+
* @returns {Uint8Array}
|
|
89
|
+
*/
|
|
90
|
+
function tokenBytes (token) {
|
|
91
|
+
if (token.encodedBytes === undefined) {
|
|
92
|
+
token.encodedBytes = token.type.equals(Type.string) ? fromString(token.value) : token.value
|
|
93
|
+
}
|
|
94
|
+
// @ts-ignore c'mon
|
|
95
|
+
return token.encodedBytes
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @param {Bl} buf
|
|
100
|
+
* @param {Token} token
|
|
101
|
+
*/
|
|
102
|
+
export function encodeBytes (buf, token) {
|
|
103
|
+
const bytes = tokenBytes(token)
|
|
104
|
+
uint.encodeUintValue(buf, token.type.majorEncoded, bytes.length)
|
|
105
|
+
buf.push(bytes)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @param {Token} token
|
|
110
|
+
* @returns {number}
|
|
111
|
+
*/
|
|
112
|
+
encodeBytes.encodedSize = function encodedSize (token) {
|
|
113
|
+
const bytes = tokenBytes(token)
|
|
114
|
+
return uint.encodeUintValue.encodedSize(bytes.length) + bytes.length
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @param {Token} tok1
|
|
119
|
+
* @param {Token} tok2
|
|
120
|
+
* @returns {number}
|
|
121
|
+
*/
|
|
122
|
+
encodeBytes.compareTokens = function compareTokens (tok1, tok2) {
|
|
123
|
+
return compareBytes(tokenBytes(tok1), tokenBytes(tok2))
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @param {Uint8Array} b1
|
|
128
|
+
* @param {Uint8Array} b2
|
|
129
|
+
* @returns {number}
|
|
130
|
+
*/
|
|
131
|
+
export function compareBytes (b1, b2) {
|
|
132
|
+
return b1.length < b2.length ? -1 : b1.length > b2.length ? 1 : compare(b1, b2)
|
|
133
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Token, Type } from './token.js'
|
|
2
|
+
import { assertEnoughData, decodeErrPrefix } from './common.js'
|
|
3
|
+
import * as uint from './0uint.js'
|
|
4
|
+
import { encodeBytes } from './2bytes.js'
|
|
5
|
+
import { toString, slice } from './byte-utils.js'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import('./bl.js').Bl} Bl
|
|
9
|
+
* @typedef {import('../interface').DecodeOptions} DecodeOptions
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {Uint8Array} data
|
|
14
|
+
* @param {number} pos
|
|
15
|
+
* @param {number} prefix
|
|
16
|
+
* @param {number} length
|
|
17
|
+
* @param {DecodeOptions} options
|
|
18
|
+
* @returns {Token}
|
|
19
|
+
*/
|
|
20
|
+
function toToken (data, pos, prefix, length, options) {
|
|
21
|
+
const totLength = prefix + length
|
|
22
|
+
assertEnoughData(data, pos, totLength)
|
|
23
|
+
const tok = new Token(Type.string, toString(data, pos + prefix, pos + totLength), totLength)
|
|
24
|
+
if (options.retainStringBytes === true) {
|
|
25
|
+
tok.byteValue = slice(data, pos + prefix, pos + totLength)
|
|
26
|
+
}
|
|
27
|
+
return tok
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {Uint8Array} data
|
|
32
|
+
* @param {number} pos
|
|
33
|
+
* @param {number} minor
|
|
34
|
+
* @param {DecodeOptions} options
|
|
35
|
+
* @returns {Token}
|
|
36
|
+
*/
|
|
37
|
+
export function decodeStringCompact (data, pos, minor, options) {
|
|
38
|
+
return toToken(data, pos, 1, minor, options)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {Uint8Array} data
|
|
43
|
+
* @param {number} pos
|
|
44
|
+
* @param {number} _minor
|
|
45
|
+
* @param {DecodeOptions} options
|
|
46
|
+
* @returns {Token}
|
|
47
|
+
*/
|
|
48
|
+
export function decodeString8 (data, pos, _minor, options) {
|
|
49
|
+
return toToken(data, pos, 2, uint.readUint8(data, pos + 1, options), options)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param {Uint8Array} data
|
|
54
|
+
* @param {number} pos
|
|
55
|
+
* @param {number} _minor
|
|
56
|
+
* @param {DecodeOptions} options
|
|
57
|
+
* @returns {Token}
|
|
58
|
+
*/
|
|
59
|
+
export function decodeString16 (data, pos, _minor, options) {
|
|
60
|
+
return toToken(data, pos, 3, uint.readUint16(data, pos + 1, options), options)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @param {Uint8Array} data
|
|
65
|
+
* @param {number} pos
|
|
66
|
+
* @param {number} _minor
|
|
67
|
+
* @param {DecodeOptions} options
|
|
68
|
+
* @returns {Token}
|
|
69
|
+
*/
|
|
70
|
+
export function decodeString32 (data, pos, _minor, options) {
|
|
71
|
+
return toToken(data, pos, 5, uint.readUint32(data, pos + 1, options), options)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// TODO: maybe we shouldn't support this ..
|
|
75
|
+
/**
|
|
76
|
+
* @param {Uint8Array} data
|
|
77
|
+
* @param {number} pos
|
|
78
|
+
* @param {number} _minor
|
|
79
|
+
* @param {DecodeOptions} options
|
|
80
|
+
* @returns {Token}
|
|
81
|
+
*/
|
|
82
|
+
export function decodeString64 (data, pos, _minor, options) {
|
|
83
|
+
const l = uint.readUint64(data, pos + 1, options)
|
|
84
|
+
if (typeof l === 'bigint') {
|
|
85
|
+
throw new Error(`${decodeErrPrefix} 64-bit integer string lengths not supported`)
|
|
86
|
+
}
|
|
87
|
+
return toToken(data, pos, 9, l, options)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const encodeString = encodeBytes
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Token, Type } from './token.js'
|
|
2
|
+
import * as uint from './0uint.js'
|
|
3
|
+
import { decodeErrPrefix } from './common.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import('./bl.js').Bl} Bl
|
|
7
|
+
* @typedef {import('../interface').DecodeOptions} DecodeOptions
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {Uint8Array} _data
|
|
12
|
+
* @param {number} _pos
|
|
13
|
+
* @param {number} prefix
|
|
14
|
+
* @param {number} length
|
|
15
|
+
* @returns {Token}
|
|
16
|
+
*/
|
|
17
|
+
function toToken (_data, _pos, prefix, length) {
|
|
18
|
+
return new Token(Type.array, length, prefix)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {Uint8Array} data
|
|
23
|
+
* @param {number} pos
|
|
24
|
+
* @param {number} minor
|
|
25
|
+
* @param {DecodeOptions} _options
|
|
26
|
+
* @returns {Token}
|
|
27
|
+
*/
|
|
28
|
+
export function decodeArrayCompact (data, pos, minor, _options) {
|
|
29
|
+
return toToken(data, pos, 1, minor)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @param {Uint8Array} data
|
|
34
|
+
* @param {number} pos
|
|
35
|
+
* @param {number} _minor
|
|
36
|
+
* @param {DecodeOptions} options
|
|
37
|
+
* @returns {Token}
|
|
38
|
+
*/
|
|
39
|
+
export function decodeArray8 (data, pos, _minor, options) {
|
|
40
|
+
return toToken(data, pos, 2, uint.readUint8(data, pos + 1, options))
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param {Uint8Array} data
|
|
45
|
+
* @param {number} pos
|
|
46
|
+
* @param {number} _minor
|
|
47
|
+
* @param {DecodeOptions} options
|
|
48
|
+
* @returns {Token}
|
|
49
|
+
*/
|
|
50
|
+
export function decodeArray16 (data, pos, _minor, options) {
|
|
51
|
+
return toToken(data, pos, 3, uint.readUint16(data, pos + 1, options))
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param {Uint8Array} data
|
|
56
|
+
* @param {number} pos
|
|
57
|
+
* @param {number} _minor
|
|
58
|
+
* @param {DecodeOptions} options
|
|
59
|
+
* @returns {Token}
|
|
60
|
+
*/
|
|
61
|
+
export function decodeArray32 (data, pos, _minor, options) {
|
|
62
|
+
return toToken(data, pos, 5, uint.readUint32(data, pos + 1, options))
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// TODO: maybe we shouldn't support this ..
|
|
66
|
+
/**
|
|
67
|
+
* @param {Uint8Array} data
|
|
68
|
+
* @param {number} pos
|
|
69
|
+
* @param {number} _minor
|
|
70
|
+
* @param {DecodeOptions} options
|
|
71
|
+
* @returns {Token}
|
|
72
|
+
*/
|
|
73
|
+
export function decodeArray64 (data, pos, _minor, options) {
|
|
74
|
+
const l = uint.readUint64(data, pos + 1, options)
|
|
75
|
+
if (typeof l === 'bigint') {
|
|
76
|
+
throw new Error(`${decodeErrPrefix} 64-bit integer array lengths not supported`)
|
|
77
|
+
}
|
|
78
|
+
return toToken(data, pos, 9, l)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @param {Uint8Array} data
|
|
83
|
+
* @param {number} pos
|
|
84
|
+
* @param {number} _minor
|
|
85
|
+
* @param {DecodeOptions} options
|
|
86
|
+
* @returns {Token}
|
|
87
|
+
*/
|
|
88
|
+
export function decodeArrayIndefinite (data, pos, _minor, options) {
|
|
89
|
+
if (options.allowIndefinite === false) {
|
|
90
|
+
throw new Error(`${decodeErrPrefix} indefinite length items not allowed`)
|
|
91
|
+
}
|
|
92
|
+
return toToken(data, pos, 1, Infinity)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @param {Bl} buf
|
|
97
|
+
* @param {Token} token
|
|
98
|
+
*/
|
|
99
|
+
export function encodeArray (buf, token) {
|
|
100
|
+
uint.encodeUintValue(buf, Type.array.majorEncoded, token.value)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// using an array as a map key, are you sure about this? we can only sort
|
|
104
|
+
// by map length here, it's up to the encoder to decide to look deeper
|
|
105
|
+
encodeArray.compareTokens = uint.encodeUint.compareTokens
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @param {Token} token
|
|
109
|
+
* @returns {number}
|
|
110
|
+
*/
|
|
111
|
+
encodeArray.encodedSize = function encodedSize (token) {
|
|
112
|
+
return uint.encodeUintValue.encodedSize(token.value)
|
|
113
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Token, Type } from './token.js'
|
|
2
|
+
import * as uint from './0uint.js'
|
|
3
|
+
import { decodeErrPrefix } from './common.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import('./bl.js').Bl} Bl
|
|
7
|
+
* @typedef {import('../interface').DecodeOptions} DecodeOptions
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {Uint8Array} _data
|
|
12
|
+
* @param {number} _pos
|
|
13
|
+
* @param {number} prefix
|
|
14
|
+
* @param {number} length
|
|
15
|
+
* @returns {Token}
|
|
16
|
+
*/
|
|
17
|
+
function toToken (_data, _pos, prefix, length) {
|
|
18
|
+
return new Token(Type.map, length, prefix)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {Uint8Array} data
|
|
23
|
+
* @param {number} pos
|
|
24
|
+
* @param {number} minor
|
|
25
|
+
* @param {DecodeOptions} _options
|
|
26
|
+
* @returns {Token}
|
|
27
|
+
*/
|
|
28
|
+
export function decodeMapCompact (data, pos, minor, _options) {
|
|
29
|
+
return toToken(data, pos, 1, minor)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @param {Uint8Array} data
|
|
34
|
+
* @param {number} pos
|
|
35
|
+
* @param {number} _minor
|
|
36
|
+
* @param {DecodeOptions} options
|
|
37
|
+
* @returns {Token}
|
|
38
|
+
*/
|
|
39
|
+
export function decodeMap8 (data, pos, _minor, options) {
|
|
40
|
+
return toToken(data, pos, 2, uint.readUint8(data, pos + 1, options))
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param {Uint8Array} data
|
|
45
|
+
* @param {number} pos
|
|
46
|
+
* @param {number} _minor
|
|
47
|
+
* @param {DecodeOptions} options
|
|
48
|
+
* @returns {Token}
|
|
49
|
+
*/
|
|
50
|
+
export function decodeMap16 (data, pos, _minor, options) {
|
|
51
|
+
return toToken(data, pos, 3, uint.readUint16(data, pos + 1, options))
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param {Uint8Array} data
|
|
56
|
+
* @param {number} pos
|
|
57
|
+
* @param {number} _minor
|
|
58
|
+
* @param {DecodeOptions} options
|
|
59
|
+
* @returns {Token}
|
|
60
|
+
*/
|
|
61
|
+
export function decodeMap32 (data, pos, _minor, options) {
|
|
62
|
+
return toToken(data, pos, 5, uint.readUint32(data, pos + 1, options))
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// TODO: maybe we shouldn't support this ..
|
|
66
|
+
/**
|
|
67
|
+
* @param {Uint8Array} data
|
|
68
|
+
* @param {number} pos
|
|
69
|
+
* @param {number} _minor
|
|
70
|
+
* @param {DecodeOptions} options
|
|
71
|
+
* @returns {Token}
|
|
72
|
+
*/
|
|
73
|
+
export function decodeMap64 (data, pos, _minor, options) {
|
|
74
|
+
const l = uint.readUint64(data, pos + 1, options)
|
|
75
|
+
if (typeof l === 'bigint') {
|
|
76
|
+
throw new Error(`${decodeErrPrefix} 64-bit integer map lengths not supported`)
|
|
77
|
+
}
|
|
78
|
+
return toToken(data, pos, 9, l)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @param {Uint8Array} data
|
|
83
|
+
* @param {number} pos
|
|
84
|
+
* @param {number} _minor
|
|
85
|
+
* @param {DecodeOptions} options
|
|
86
|
+
* @returns {Token}
|
|
87
|
+
*/
|
|
88
|
+
export function decodeMapIndefinite (data, pos, _minor, options) {
|
|
89
|
+
if (options.allowIndefinite === false) {
|
|
90
|
+
throw new Error(`${decodeErrPrefix} indefinite length items not allowed`)
|
|
91
|
+
}
|
|
92
|
+
return toToken(data, pos, 1, Infinity)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @param {Bl} buf
|
|
97
|
+
* @param {Token} token
|
|
98
|
+
*/
|
|
99
|
+
export function encodeMap (buf, token) {
|
|
100
|
+
uint.encodeUintValue(buf, Type.map.majorEncoded, token.value)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// using a map as a map key, are you sure about this? we can only sort
|
|
104
|
+
// by map length here, it's up to the encoder to decide to look deeper
|
|
105
|
+
encodeMap.compareTokens = uint.encodeUint.compareTokens
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @param {Token} token
|
|
109
|
+
* @returns {number}
|
|
110
|
+
*/
|
|
111
|
+
encodeMap.encodedSize = function encodedSize (token) {
|
|
112
|
+
return uint.encodeUintValue.encodedSize(token.value)
|
|
113
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Token, Type } from './token.js'
|
|
2
|
+
import * as uint from './0uint.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('./bl.js').Bl} Bl
|
|
6
|
+
* @typedef {import('../interface').DecodeOptions} DecodeOptions
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {Uint8Array} _data
|
|
11
|
+
* @param {number} _pos
|
|
12
|
+
* @param {number} minor
|
|
13
|
+
* @param {DecodeOptions} _options
|
|
14
|
+
* @returns {Token}
|
|
15
|
+
*/
|
|
16
|
+
export function decodeTagCompact (_data, _pos, minor, _options) {
|
|
17
|
+
return new Token(Type.tag, minor, 1)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {Uint8Array} data
|
|
22
|
+
* @param {number} pos
|
|
23
|
+
* @param {number} _minor
|
|
24
|
+
* @param {DecodeOptions} options
|
|
25
|
+
* @returns {Token}
|
|
26
|
+
*/
|
|
27
|
+
export function decodeTag8 (data, pos, _minor, options) {
|
|
28
|
+
return new Token(Type.tag, uint.readUint8(data, pos + 1, options), 2)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param {Uint8Array} data
|
|
33
|
+
* @param {number} pos
|
|
34
|
+
* @param {number} _minor
|
|
35
|
+
* @param {DecodeOptions} options
|
|
36
|
+
* @returns {Token}
|
|
37
|
+
*/
|
|
38
|
+
export function decodeTag16 (data, pos, _minor, options) {
|
|
39
|
+
return new Token(Type.tag, uint.readUint16(data, pos + 1, options), 3)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param {Uint8Array} data
|
|
44
|
+
* @param {number} pos
|
|
45
|
+
* @param {number} _minor
|
|
46
|
+
* @param {DecodeOptions} options
|
|
47
|
+
* @returns {Token}
|
|
48
|
+
*/
|
|
49
|
+
export function decodeTag32 (data, pos, _minor, options) {
|
|
50
|
+
return new Token(Type.tag, uint.readUint32(data, pos + 1, options), 5)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @param {Uint8Array} data
|
|
55
|
+
* @param {number} pos
|
|
56
|
+
* @param {number} _minor
|
|
57
|
+
* @param {DecodeOptions} options
|
|
58
|
+
* @returns {Token}
|
|
59
|
+
*/
|
|
60
|
+
export function decodeTag64 (data, pos, _minor, options) {
|
|
61
|
+
return new Token(Type.tag, uint.readUint64(data, pos + 1, options), 9)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @param {Bl} buf
|
|
66
|
+
* @param {Token} token
|
|
67
|
+
*/
|
|
68
|
+
export function encodeTag (buf, token) {
|
|
69
|
+
uint.encodeUintValue(buf, Type.tag.majorEncoded, token.value)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
encodeTag.compareTokens = uint.encodeUint.compareTokens
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @param {Token} token
|
|
76
|
+
* @returns {number}
|
|
77
|
+
*/
|
|
78
|
+
encodeTag.encodedSize = function encodedSize (token) {
|
|
79
|
+
return uint.encodeUintValue.encodedSize(token.value)
|
|
80
|
+
}
|