mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 05:21:02 +00:00
1 line
7.5 KiB
Plaintext
1 line
7.5 KiB
Plaintext
{"dependencies":[{"name":"../bn/index.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":69,"index":69}}],"key":"fl0HmZYDIy1pebLP0IDMy9U2bI4=","exportNames":["*"],"imports":1}},{"name":"../u8a/index.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":2,"column":0,"index":70},"end":{"line":2,"column":50,"index":120}}],"key":"ni7N8kFqexhxzrkt71zvvxQnrBA=","exportNames":["*"],"imports":1}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n exports.compactToU8a = compactToU8a;\n var _bnIndexJs = require(_dependencyMap[0], \"../bn/index.js\");\n var _u8aIndexJs = require(_dependencyMap[1], \"../u8a/index.js\");\n const MAX_U8 = _bnIndexJs.BN_TWO.pow(new _bnIndexJs.BN(8 - 2)).isub(_bnIndexJs.BN_ONE);\n const MAX_U16 = _bnIndexJs.BN_TWO.pow(new _bnIndexJs.BN(16 - 2)).isub(_bnIndexJs.BN_ONE);\n const MAX_U32 = _bnIndexJs.BN_TWO.pow(new _bnIndexJs.BN(32 - 2)).isub(_bnIndexJs.BN_ONE);\n const BL_16 = {\n bitLength: 16\n };\n const BL_32 = {\n bitLength: 32\n };\n /**\n * @name compactToU8a\n * @description Encodes a number into a compact representation\n * @example\n * <BR>\n *\n * ```javascript\n * import { compactToU8a } from '@polkadot/util';\n *\n * console.log(compactToU8a(511, 32)); // Uint8Array([0b11111101, 0b00000111])\n * ```\n */\n function compactToU8a(value) {\n const bn = (0, _bnIndexJs.bnToBn)(value);\n if (bn.lte(MAX_U8)) {\n return new Uint8Array([bn.toNumber() << 2]);\n } else if (bn.lte(MAX_U16)) {\n return (0, _bnIndexJs.bnToU8a)(bn.shln(2).iadd(_bnIndexJs.BN_ONE), BL_16);\n } else if (bn.lte(MAX_U32)) {\n return (0, _bnIndexJs.bnToU8a)(bn.shln(2).iadd(_bnIndexJs.BN_TWO), BL_32);\n }\n const u8a = (0, _bnIndexJs.bnToU8a)(bn);\n let length = u8a.length;\n // adjust to the minimum number of bytes\n while (u8a[length - 1] === 0) {\n length--;\n }\n if (length < 4) {\n throw new Error('Invalid length, previous checks match anything less than 2^30');\n }\n return (0, _u8aIndexJs.u8aConcatStrict)([\n // subtract 4 as minimum (also catered for in decoding)\n new Uint8Array([(length - 4 << 2) + 0b11]), u8a.subarray(0, length)]);\n }\n});","lineCount":53,"map":[[7,2,20,0,"exports"],[7,9,20,0],[7,10,20,0,"compactToU8a"],[7,22,20,0],[7,25,20,0,"compactToU8a"],[7,37,20,0],[8,2,1,0],[8,6,1,0,"_bnIndexJs"],[8,16,1,0],[8,19,1,0,"require"],[8,26,1,0],[8,27,1,0,"_dependencyMap"],[8,41,1,0],[9,2,2,0],[9,6,2,0,"_u8aIndexJs"],[9,17,2,0],[9,20,2,0,"require"],[9,27,2,0],[9,28,2,0,"_dependencyMap"],[9,42,2,0],[10,2,3,0],[10,8,3,6,"MAX_U8"],[10,14,3,12],[10,17,3,15,"BN_TWO"],[10,27,3,21],[10,28,3,21,"BN_TWO"],[10,34,3,21],[10,35,3,22,"pow"],[10,38,3,25],[10,39,3,26],[10,43,3,30,"BN"],[10,53,3,32],[10,54,3,32,"BN"],[10,56,3,32],[10,57,3,33],[10,58,3,34],[10,61,3,37],[10,62,3,38],[10,63,3,39],[10,64,3,40],[10,65,3,41,"isub"],[10,69,3,45],[10,70,3,46,"BN_ONE"],[10,80,3,52],[10,81,3,52,"BN_ONE"],[10,87,3,52],[10,88,3,53],[11,2,4,0],[11,8,4,6,"MAX_U16"],[11,15,4,13],[11,18,4,16,"BN_TWO"],[11,28,4,22],[11,29,4,22,"BN_TWO"],[11,35,4,22],[11,36,4,23,"pow"],[11,39,4,26],[11,40,4,27],[11,44,4,31,"BN"],[11,54,4,33],[11,55,4,33,"BN"],[11,57,4,33],[11,58,4,34],[11,60,4,36],[11,63,4,39],[11,64,4,40],[11,65,4,41],[11,66,4,42],[11,67,4,43,"isub"],[11,71,4,47],[11,72,4,48,"BN_ONE"],[11,82,4,54],[11,83,4,54,"BN_ONE"],[11,89,4,54],[11,90,4,55],[12,2,5,0],[12,8,5,6,"MAX_U32"],[12,15,5,13],[12,18,5,16,"BN_TWO"],[12,28,5,22],[12,29,5,22,"BN_TWO"],[12,35,5,22],[12,36,5,23,"pow"],[12,39,5,26],[12,40,5,27],[12,44,5,31,"BN"],[12,54,5,33],[12,55,5,33,"BN"],[12,57,5,33],[12,58,5,34],[12,60,5,36],[12,63,5,39],[12,64,5,40],[12,65,5,41],[12,66,5,42],[12,67,5,43,"isub"],[12,71,5,47],[12,72,5,48,"BN_ONE"],[12,82,5,54],[12,83,5,54,"BN_ONE"],[12,89,5,54],[12,90,5,55],[13,2,6,0],[13,8,6,6,"BL_16"],[13,13,6,11],[13,16,6,14],[14,4,6,16,"bitLength"],[14,13,6,25],[14,15,6,27],[15,2,6,30],[15,3,6,31],[16,2,7,0],[16,8,7,6,"BL_32"],[16,13,7,11],[16,16,7,14],[17,4,7,16,"bitLength"],[17,13,7,25],[17,15,7,27],[18,2,7,30],[18,3,7,31],[19,2,8,0],[20,0,9,0],[21,0,10,0],[22,0,11,0],[23,0,12,0],[24,0,13,0],[25,0,14,0],[26,0,15,0],[27,0,16,0],[28,0,17,0],[29,0,18,0],[30,0,19,0],[31,2,20,7],[31,11,20,16,"compactToU8a"],[31,23,20,28,"compactToU8a"],[31,24,20,29,"value"],[31,29,20,34],[31,31,20,36],[32,4,21,4],[32,10,21,10,"bn"],[32,12,21,12],[32,15,21,15],[32,19,21,15,"bnToBn"],[32,29,21,21],[32,30,21,21,"bnToBn"],[32,36,21,21],[32,38,21,22,"value"],[32,43,21,27],[32,44,21,28],[33,4,22,4],[33,8,22,8,"bn"],[33,10,22,10],[33,11,22,11,"lte"],[33,14,22,14],[33,15,22,15,"MAX_U8"],[33,21,22,21],[33,22,22,22],[33,24,22,24],[34,6,23,8],[34,13,23,15],[34,17,23,19,"Uint8Array"],[34,27,23,29],[34,28,23,30],[34,29,23,31,"bn"],[34,31,23,33],[34,32,23,34,"toNumber"],[34,40,23,42],[34,41,23,43],[34,42,23,44],[34,46,23,48],[34,47,23,49],[34,48,23,50],[34,49,23,51],[35,4,24,4],[35,5,24,5],[35,11,25,9],[35,15,25,13,"bn"],[35,17,25,15],[35,18,25,16,"lte"],[35,21,25,19],[35,22,25,20,"MAX_U16"],[35,29,25,27],[35,30,25,28],[35,32,25,30],[36,6,26,8],[36,13,26,15],[36,17,26,15,"bnToU8a"],[36,27,26,22],[36,28,26,22,"bnToU8a"],[36,35,26,22],[36,37,26,23,"bn"],[36,39,26,25],[36,40,26,26,"shln"],[36,44,26,30],[36,45,26,31],[36,46,26,32],[36,47,26,33],[36,48,26,34,"iadd"],[36,52,26,38],[36,53,26,39,"BN_ONE"],[36,63,26,45],[36,64,26,45,"BN_ONE"],[36,70,26,45],[36,71,26,46],[36,73,26,48,"BL_16"],[36,78,26,53],[36,79,26,54],[37,4,27,4],[37,5,27,5],[37,11,28,9],[37,15,28,13,"bn"],[37,17,28,15],[37,18,28,16,"lte"],[37,21,28,19],[37,22,28,20,"MAX_U32"],[37,29,28,27],[37,30,28,28],[37,32,28,30],[38,6,29,8],[38,13,29,15],[38,17,29,15,"bnToU8a"],[38,27,29,22],[38,28,29,22,"bnToU8a"],[38,35,29,22],[38,37,29,23,"bn"],[38,39,29,25],[38,40,29,26,"shln"],[38,44,29,30],[38,45,29,31],[38,46,29,32],[38,47,29,33],[38,48,29,34,"iadd"],[38,52,29,38],[38,53,29,39,"BN_TWO"],[38,63,29,45],[38,64,29,45,"BN_TWO"],[38,70,29,45],[38,71,29,46],[38,73,29,48,"BL_32"],[38,78,29,53],[38,79,29,54],[39,4,30,4],[40,4,31,4],[40,10,31,10,"u8a"],[40,13,31,13],[40,16,31,16],[40,20,31,16,"bnToU8a"],[40,30,31,23],[40,31,31,23,"bnToU8a"],[40,38,31,23],[40,40,31,24,"bn"],[40,42,31,26],[40,43,31,27],[41,4,32,4],[41,8,32,8,"length"],[41,14,32,14],[41,17,32,17,"u8a"],[41,20,32,20],[41,21,32,21,"length"],[41,27,32,27],[42,4,33,4],[43,4,34,4],[43,11,34,11,"u8a"],[43,14,34,14],[43,15,34,15,"length"],[43,21,34,21],[43,24,34,24],[43,25,34,25],[43,26,34,26],[43,31,34,31],[43,32,34,32],[43,34,34,34],[44,6,35,8,"length"],[44,12,35,14],[44,14,35,16],[45,4,36,4],[46,4,37,4],[46,8,37,8,"length"],[46,14,37,14],[46,17,37,17],[46,18,37,18],[46,20,37,20],[47,6,38,8],[47,12,38,14],[47,16,38,18,"Error"],[47,21,38,23],[47,22,38,24],[47,85,38,87],[47,86,38,88],[48,4,39,4],[49,4,40,4],[49,11,40,11],[49,15,40,11,"u8aConcatStrict"],[49,26,40,26],[49,27,40,26,"u8aConcatStrict"],[49,42,40,26],[49,44,40,27],[50,4,41,8],[51,4,42,8],[51,8,42,12,"Uint8Array"],[51,18,42,22],[51,19,42,23],[51,20,42,24],[51,21,42,26,"length"],[51,27,42,32],[51,30,42,35],[51,31,42,36],[51,35,42,41],[51,36,42,42],[51,40,42,46],[51,44,42,50],[51,45,42,51],[51,46,42,52],[51,48,43,8,"u8a"],[51,51,43,11],[51,52,43,12,"subarray"],[51,60,43,20],[51,61,43,21],[51,62,43,22],[51,64,43,24,"length"],[51,70,43,30],[51,71,43,31],[51,72,44,5],[51,73,44,6],[52,2,45,0],[53,0,45,1],[53,3]],"functionMap":{"names":["<global>","compactToU8a"],"mappings":"AAA;OCmB;CDyB"},"hasCjsExports":false},"type":"js/module"}]} |