mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 03:01:04 +00:00
1 line
7.3 KiB
Plaintext
1 line
7.3 KiB
Plaintext
{"dependencies":[],"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.hexToU8a = hexToU8a;\n var CHR = '0123456789abcdef';\n var U8 = new Uint8Array(256);\n var U16 = new Uint8Array(256 * 256);\n for (var i = 0, count = CHR.length; i < count; i++) {\n U8[CHR[i].charCodeAt(0) | 0] = i | 0;\n if (i > 9) {\n U8[CHR[i].toUpperCase().charCodeAt(0) | 0] = i | 0;\n }\n }\n for (var _i = 0; _i < 256; _i++) {\n var s = _i << 8;\n for (var j = 0; j < 256; j++) {\n U16[s | j] = U8[_i] << 4 | U8[j];\n }\n }\n /**\n * @name hexToU8a\n * @summary Creates a Uint8Array object from a hex string.\n * @description\n * `null` inputs returns an empty `Uint8Array` result. Hex input values return the actual bytes value converted to a Uint8Array. Anything that is not a hex string (including the `0x` prefix) throws an error.\n * @example\n * <BR>\n *\n * ```javascript\n * import { hexToU8a } from '@polkadot/util';\n *\n * hexToU8a('0x80001f'); // Uint8Array([0x80, 0x00, 0x1f])\n * hexToU8a('0x80001f', 32); // Uint8Array([0x00, 0x80, 0x00, 0x1f])\n * ```\n */\n function hexToU8a(value) {\n var bitLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;\n if (!value) {\n return new Uint8Array();\n }\n var s = value.startsWith('0x') ? 2 : 0;\n var decLength = Math.ceil((value.length - s) / 2);\n var endLength = Math.ceil(bitLength === -1 ? decLength : bitLength / 8);\n var result = new Uint8Array(endLength);\n var offset = endLength > decLength ? endLength - decLength : 0;\n for (var _i2 = offset; _i2 < endLength; _i2++, s += 2) {\n // The big factor here is actually the string lookups. If we do\n // HEX_TO_U16[value.substring()] we get an 10x slowdown. In the\n // same vein using charCodeAt (as opposed to value[s] or value.charAt(s)) is\n // also the faster operation by at least 2x with the character map above\n result[_i2] = U16[value.charCodeAt(s) << 8 | value.charCodeAt(s + 1)];\n }\n return result;\n }\n});","lineCount":57,"map":[[7,2,31,0,"exports"],[7,9,31,0],[7,10,31,0,"hexToU8a"],[7,18,31,0],[7,21,31,0,"hexToU8a"],[7,29,31,0],[8,2,1,0],[8,6,1,6,"CHR"],[8,9,1,9],[8,12,1,12],[8,30,1,30],[9,2,2,0],[9,6,2,6,"U8"],[9,8,2,8],[9,11,2,11],[9,15,2,15,"Uint8Array"],[9,25,2,25],[9,26,2,26],[9,29,2,29],[9,30,2,30],[10,2,3,0],[10,6,3,6,"U16"],[10,9,3,9],[10,12,3,12],[10,16,3,16,"Uint8Array"],[10,26,3,26],[10,27,3,27],[10,30,3,30],[10,33,3,33],[10,36,3,36],[10,37,3,37],[11,2,4,0],[11,7,4,5],[11,11,4,9,"i"],[11,12,4,10],[11,15,4,13],[11,16,4,14],[11,18,4,16,"count"],[11,23,4,21],[11,26,4,24,"CHR"],[11,29,4,27],[11,30,4,28,"length"],[11,36,4,34],[11,38,4,36,"i"],[11,39,4,37],[11,42,4,40,"count"],[11,47,4,45],[11,49,4,47,"i"],[11,50,4,48],[11,52,4,50],[11,54,4,52],[12,4,5,4,"U8"],[12,6,5,6],[12,7,5,7,"CHR"],[12,10,5,10],[12,11,5,11,"i"],[12,12,5,12],[12,13,5,13],[12,14,5,14,"charCodeAt"],[12,24,5,24],[12,25,5,25],[12,26,5,26],[12,27,5,27],[12,30,5,30],[12,31,5,31],[12,32,5,32],[12,35,5,35,"i"],[12,36,5,36],[12,39,5,39],[12,40,5,40],[13,4,6,4],[13,8,6,8,"i"],[13,9,6,9],[13,12,6,12],[13,13,6,13],[13,15,6,15],[14,6,7,8,"U8"],[14,8,7,10],[14,9,7,11,"CHR"],[14,12,7,14],[14,13,7,15,"i"],[14,14,7,16],[14,15,7,17],[14,16,7,18,"toUpperCase"],[14,27,7,29],[14,28,7,30],[14,29,7,31],[14,30,7,32,"charCodeAt"],[14,40,7,42],[14,41,7,43],[14,42,7,44],[14,43,7,45],[14,46,7,48],[14,47,7,49],[14,48,7,50],[14,51,7,53,"i"],[14,52,7,54],[14,55,7,57],[14,56,7,58],[15,4,8,4],[16,2,9,0],[17,2,10,0],[17,7,10,5],[17,11,10,9,"i"],[17,13,10,10],[17,16,10,13],[17,17,10,14],[17,19,10,16,"i"],[17,21,10,17],[17,24,10,20],[17,27,10,23],[17,29,10,25,"i"],[17,31,10,26],[17,33,10,28],[17,35,10,30],[18,4,11,4],[18,8,11,10,"s"],[18,9,11,11],[18,12,11,14,"i"],[18,14,11,15],[18,18,11,19],[18,19,11,20],[19,4,12,4],[19,9,12,9],[19,13,12,13,"j"],[19,14,12,14],[19,17,12,17],[19,18,12,18],[19,20,12,20,"j"],[19,21,12,21],[19,24,12,24],[19,27,12,27],[19,29,12,29,"j"],[19,30,12,30],[19,32,12,32],[19,34,12,34],[20,6,13,8,"U16"],[20,9,13,11],[20,10,13,12,"s"],[20,11,13,13],[20,14,13,16,"j"],[20,15,13,17],[20,16,13,18],[20,19,13,22,"U8"],[20,21,13,24],[20,22,13,25,"i"],[20,24,13,26],[20,25,13,27],[20,29,13,31],[20,30,13,32],[20,33,13,36,"U8"],[20,35,13,38],[20,36,13,39,"j"],[20,37,13,40],[20,38,13,41],[21,4,14,4],[22,2,15,0],[23,2,16,0],[24,0,17,0],[25,0,18,0],[26,0,19,0],[27,0,20,0],[28,0,21,0],[29,0,22,0],[30,0,23,0],[31,0,24,0],[32,0,25,0],[33,0,26,0],[34,0,27,0],[35,0,28,0],[36,0,29,0],[37,0,30,0],[38,2,31,7],[38,11,31,16,"hexToU8a"],[38,19,31,24,"hexToU8a"],[38,20,31,25,"value"],[38,25,31,30],[38,27,31,48],[39,4,31,48],[39,8,31,32,"bitLength"],[39,17,31,41],[39,20,31,41,"arguments"],[39,29,31,41],[39,30,31,41,"length"],[39,36,31,41],[39,44,31,41,"arguments"],[39,53,31,41],[39,61,31,41,"undefined"],[39,70,31,41],[39,73,31,41,"arguments"],[39,82,31,41],[39,88,31,44],[39,89,31,45],[39,90,31,46],[40,4,32,4],[40,8,32,8],[40,9,32,9,"value"],[40,14,32,14],[40,16,32,16],[41,6,33,8],[41,13,33,15],[41,17,33,19,"Uint8Array"],[41,27,33,29],[41,28,33,30],[41,29,33,31],[42,4,34,4],[43,4,35,4],[43,8,35,8,"s"],[43,9,35,9],[43,12,35,12,"value"],[43,17,35,17],[43,18,35,18,"startsWith"],[43,28,35,28],[43,29,35,29],[43,33,35,33],[43,34,35,34],[43,37,36,10],[43,38,36,11],[43,41,37,10],[43,42,37,11],[44,4,38,4],[44,8,38,10,"decLength"],[44,17,38,19],[44,20,38,22,"Math"],[44,24,38,26],[44,25,38,27,"ceil"],[44,29,38,31],[44,30,38,32],[44,31,38,33,"value"],[44,36,38,38],[44,37,38,39,"length"],[44,43,38,45],[44,46,38,48,"s"],[44,47,38,49],[44,51,38,53],[44,52,38,54],[44,53,38,55],[45,4,39,4],[45,8,39,10,"endLength"],[45,17,39,19],[45,20,39,22,"Math"],[45,24,39,26],[45,25,39,27,"ceil"],[45,29,39,31],[45,30,39,32,"bitLength"],[45,39,39,41],[45,44,39,46],[45,45,39,47],[45,46,39,48],[45,49,40,10,"decLength"],[45,58,40,19],[45,61,41,10,"bitLength"],[45,70,41,19],[45,73,41,22],[45,74,41,23],[45,75,41,24],[46,4,42,4],[46,8,42,10,"result"],[46,14,42,16],[46,17,42,19],[46,21,42,23,"Uint8Array"],[46,31,42,33],[46,32,42,34,"endLength"],[46,41,42,43],[46,42,42,44],[47,4,43,4],[47,8,43,10,"offset"],[47,14,43,16],[47,17,43,19,"endLength"],[47,26,43,28],[47,29,43,31,"decLength"],[47,38,43,40],[47,41,44,10,"endLength"],[47,50,44,19],[47,53,44,22,"decLength"],[47,62,44,31],[47,65,45,10],[47,66,45,11],[48,4,46,4],[48,9,46,9],[48,13,46,13,"i"],[48,16,46,14],[48,19,46,17,"offset"],[48,25,46,23],[48,27,46,25,"i"],[48,30,46,26],[48,33,46,29,"endLength"],[48,42,46,38],[48,44,46,40,"i"],[48,47,46,41],[48,49,46,43],[48,51,46,45,"s"],[48,52,46,46],[48,56,46,50],[48,57,46,51],[48,59,46,53],[49,6,47,8],[50,6,48,8],[51,6,49,8],[52,6,50,8],[53,6,51,8,"result"],[53,12,51,14],[53,13,51,15,"i"],[53,16,51,16],[53,17,51,17],[53,20,51,20,"U16"],[53,23,51,23],[53,24,51,25,"value"],[53,29,51,30],[53,30,51,31,"charCodeAt"],[53,40,51,41],[53,41,51,42,"s"],[53,42,51,43],[53,43,51,44],[53,47,51,48],[53,48,51,49],[53,51,51,53,"value"],[53,56,51,58],[53,57,51,59,"charCodeAt"],[53,67,51,69],[53,68,51,70,"s"],[53,69,51,71],[53,72,51,74],[53,73,51,75],[53,74,51,76],[53,75,51,77],[54,4,52,4],[55,4,53,4],[55,11,53,11,"result"],[55,17,53,17],[56,2,54,0],[57,0,54,1],[57,3]],"functionMap":{"names":["<global>","hexToU8a"],"mappings":"AAA;OC8B;CDuB"},"hasCjsExports":false},"type":"js/module"}]} |