mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 14:31:02 +00:00
1 line
7.1 KiB
Plaintext
1 line
7.1 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 const CHR = '0123456789abcdef';\n const U8 = new Uint8Array(256);\n const U16 = new Uint8Array(256 * 256);\n for (let 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 (let i = 0; i < 256; i++) {\n const s = i << 8;\n for (let 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, bitLength = -1) {\n if (!value) {\n return new Uint8Array();\n }\n let s = value.startsWith('0x') ? 2 : 0;\n const decLength = Math.ceil((value.length - s) / 2);\n const endLength = Math.ceil(bitLength === -1 ? decLength : bitLength / 8);\n const result = new Uint8Array(endLength);\n const offset = endLength > decLength ? endLength - decLength : 0;\n for (let i = offset; i < endLength; i++, 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[i] = U16[value.charCodeAt(s) << 8 | value.charCodeAt(s + 1)];\n }\n return result;\n }\n});","lineCount":56,"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,8,1,6,"CHR"],[8,11,1,9],[8,14,1,12],[8,32,1,30],[9,2,2,0],[9,8,2,6,"U8"],[9,10,2,8],[9,13,2,11],[9,17,2,15,"Uint8Array"],[9,27,2,25],[9,28,2,26],[9,31,2,29],[9,32,2,30],[10,2,3,0],[10,8,3,6,"U16"],[10,11,3,9],[10,14,3,12],[10,18,3,16,"Uint8Array"],[10,28,3,26],[10,29,3,27],[10,32,3,30],[10,35,3,33],[10,38,3,36],[10,39,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,12,10,10],[17,15,10,13],[17,16,10,14],[17,18,10,16,"i"],[17,19,10,17],[17,22,10,20],[17,25,10,23],[17,27,10,25,"i"],[17,28,10,26],[17,30,10,28],[17,32,10,30],[18,4,11,4],[18,10,11,10,"s"],[18,11,11,11],[18,14,11,14,"i"],[18,15,11,15],[18,19,11,19],[18,20,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,23,13,26],[20,24,13,27],[20,28,13,31],[20,29,13,32],[20,32,13,36,"U8"],[20,34,13,38],[20,35,13,39,"j"],[20,36,13,40],[20,37,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,32,"bitLength"],[38,36,31,41],[38,39,31,44],[38,40,31,45],[38,41,31,46],[38,43,31,48],[39,4,32,4],[39,8,32,8],[39,9,32,9,"value"],[39,14,32,14],[39,16,32,16],[40,6,33,8],[40,13,33,15],[40,17,33,19,"Uint8Array"],[40,27,33,29],[40,28,33,30],[40,29,33,31],[41,4,34,4],[42,4,35,4],[42,8,35,8,"s"],[42,9,35,9],[42,12,35,12,"value"],[42,17,35,17],[42,18,35,18,"startsWith"],[42,28,35,28],[42,29,35,29],[42,33,35,33],[42,34,35,34],[42,37,36,10],[42,38,36,11],[42,41,37,10],[42,42,37,11],[43,4,38,4],[43,10,38,10,"decLength"],[43,19,38,19],[43,22,38,22,"Math"],[43,26,38,26],[43,27,38,27,"ceil"],[43,31,38,31],[43,32,38,32],[43,33,38,33,"value"],[43,38,38,38],[43,39,38,39,"length"],[43,45,38,45],[43,48,38,48,"s"],[43,49,38,49],[43,53,38,53],[43,54,38,54],[43,55,38,55],[44,4,39,4],[44,10,39,10,"endLength"],[44,19,39,19],[44,22,39,22,"Math"],[44,26,39,26],[44,27,39,27,"ceil"],[44,31,39,31],[44,32,39,32,"bitLength"],[44,41,39,41],[44,46,39,46],[44,47,39,47],[44,48,39,48],[44,51,40,10,"decLength"],[44,60,40,19],[44,63,41,10,"bitLength"],[44,72,41,19],[44,75,41,22],[44,76,41,23],[44,77,41,24],[45,4,42,4],[45,10,42,10,"result"],[45,16,42,16],[45,19,42,19],[45,23,42,23,"Uint8Array"],[45,33,42,33],[45,34,42,34,"endLength"],[45,43,42,43],[45,44,42,44],[46,4,43,4],[46,10,43,10,"offset"],[46,16,43,16],[46,19,43,19,"endLength"],[46,28,43,28],[46,31,43,31,"decLength"],[46,40,43,40],[46,43,44,10,"endLength"],[46,52,44,19],[46,55,44,22,"decLength"],[46,64,44,31],[46,67,45,10],[46,68,45,11],[47,4,46,4],[47,9,46,9],[47,13,46,13,"i"],[47,14,46,14],[47,17,46,17,"offset"],[47,23,46,23],[47,25,46,25,"i"],[47,26,46,26],[47,29,46,29,"endLength"],[47,38,46,38],[47,40,46,40,"i"],[47,41,46,41],[47,43,46,43],[47,45,46,45,"s"],[47,46,46,46],[47,50,46,50],[47,51,46,51],[47,53,46,53],[48,6,47,8],[49,6,48,8],[50,6,49,8],[51,6,50,8],[52,6,51,8,"result"],[52,12,51,14],[52,13,51,15,"i"],[52,14,51,16],[52,15,51,17],[52,18,51,20,"U16"],[52,21,51,23],[52,22,51,25,"value"],[52,27,51,30],[52,28,51,31,"charCodeAt"],[52,38,51,41],[52,39,51,42,"s"],[52,40,51,43],[52,41,51,44],[52,45,51,48],[52,46,51,49],[52,49,51,53,"value"],[52,54,51,58],[52,55,51,59,"charCodeAt"],[52,65,51,69],[52,66,51,70,"s"],[52,67,51,71],[52,70,51,74],[52,71,51,75],[52,72,51,76],[52,73,51,77],[53,4,52,4],[54,4,53,4],[54,11,53,11,"result"],[54,17,53,17],[55,2,54,0],[56,0,54,1],[56,3]],"functionMap":{"names":["<global>","hexToU8a"],"mappings":"AAA;OC8B;CDuB"},"hasCjsExports":false},"type":"js/module"}]} |