mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 14:31:02 +00:00
1 line
4.8 KiB
Plaintext
1 line
4.8 KiB
Plaintext
{"dependencies":[{"name":"./toBn.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":35,"index":35}}],"key":"8EntuEUsDsexzhZ3v43XT4EffMM=","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.bnToU8a = bnToU8a;\n var _toBnJs = require(_dependencyMap[0], \"./toBn.js\");\n const DEFAULT_OPTS = {\n bitLength: -1,\n isLe: true,\n isNegative: false\n };\n /**\n * @name bnToU8a\n * @summary Creates a Uint8Array object from a BN.\n * @description\n * `null`/`undefined`/`NaN` inputs returns an empty `Uint8Array` result. `BN` input values return the actual bytes value converted to a `Uint8Array`. Optionally convert using little-endian format if `isLE` is set.\n * @example\n * <BR>\n *\n * ```javascript\n * import { bnToU8a } from '@polkadot/util';\n *\n * bnToU8a(new BN(0x1234)); // => [0x12, 0x34]\n * ```\n */\n function bnToU8a(value, {\n bitLength = -1,\n isLe = true,\n isNegative = false\n } = DEFAULT_OPTS) {\n const valueBn = (0, _toBnJs.bnToBn)(value);\n const byteLength = bitLength === -1 ? Math.ceil(valueBn.bitLength() / 8) : Math.ceil((bitLength || 0) / 8);\n if (!value) {\n return bitLength === -1 ? new Uint8Array(1) : new Uint8Array(byteLength);\n }\n const output = new Uint8Array(byteLength);\n const bn = isNegative ? valueBn.toTwos(byteLength * 8) : valueBn;\n output.set(bn.toArray(isLe ? 'le' : 'be', byteLength), 0);\n return output;\n }\n});","lineCount":43,"map":[[7,2,17,0,"exports"],[7,9,17,0],[7,10,17,0,"bnToU8a"],[7,17,17,0],[7,20,17,0,"bnToU8a"],[7,27,17,0],[8,2,1,0],[8,6,1,0,"_toBnJs"],[8,13,1,0],[8,16,1,0,"require"],[8,23,1,0],[8,24,1,0,"_dependencyMap"],[8,38,1,0],[9,2,2,0],[9,8,2,6,"DEFAULT_OPTS"],[9,20,2,18],[9,23,2,21],[10,4,2,23,"bitLength"],[10,13,2,32],[10,15,2,34],[10,16,2,35],[10,17,2,36],[11,4,2,38,"isLe"],[11,8,2,42],[11,10,2,44],[11,14,2,48],[12,4,2,50,"isNegative"],[12,14,2,60],[12,16,2,62],[13,2,2,68],[13,3,2,69],[14,2,3,0],[15,0,4,0],[16,0,5,0],[17,0,6,0],[18,0,7,0],[19,0,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,2,17,7],[28,11,17,16,"bnToU8a"],[28,18,17,23,"bnToU8a"],[28,19,17,24,"value"],[28,24,17,29],[28,26,17,31],[29,4,17,33,"bitLength"],[29,13,17,42],[29,16,17,45],[29,17,17,46],[29,18,17,47],[30,4,17,49,"isLe"],[30,8,17,53],[30,11,17,56],[30,15,17,60],[31,4,17,62,"isNegative"],[31,14,17,72],[31,17,17,75],[32,2,17,81],[32,3,17,82],[32,6,17,85,"DEFAULT_OPTS"],[32,18,17,97],[32,20,17,99],[33,4,18,4],[33,10,18,10,"valueBn"],[33,17,18,17],[33,20,18,20],[33,24,18,20,"bnToBn"],[33,31,18,26],[33,32,18,26,"bnToBn"],[33,38,18,26],[33,40,18,27,"value"],[33,45,18,32],[33,46,18,33],[34,4,19,4],[34,10,19,10,"byteLength"],[34,20,19,20],[34,23,19,23,"bitLength"],[34,32,19,32],[34,37,19,37],[34,38,19,38],[34,39,19,39],[34,42,20,10,"Math"],[34,46,20,14],[34,47,20,15,"ceil"],[34,51,20,19],[34,52,20,20,"valueBn"],[34,59,20,27],[34,60,20,28,"bitLength"],[34,69,20,37],[34,70,20,38],[34,71,20,39],[34,74,20,42],[34,75,20,43],[34,76,20,44],[34,79,21,10,"Math"],[34,83,21,14],[34,84,21,15,"ceil"],[34,88,21,19],[34,89,21,20],[34,90,21,21,"bitLength"],[34,99,21,30],[34,103,21,34],[34,104,21,35],[34,108,21,39],[34,109,21,40],[34,110,21,41],[35,4,22,4],[35,8,22,8],[35,9,22,9,"value"],[35,14,22,14],[35,16,22,16],[36,6,23,8],[36,13,23,15,"bitLength"],[36,22,23,24],[36,27,23,29],[36,28,23,30],[36,29,23,31],[36,32,24,14],[36,36,24,18,"Uint8Array"],[36,46,24,28],[36,47,24,29],[36,48,24,30],[36,49,24,31],[36,52,25,14],[36,56,25,18,"Uint8Array"],[36,66,25,28],[36,67,25,29,"byteLength"],[36,77,25,39],[36,78,25,40],[37,4,26,4],[38,4,27,4],[38,10,27,10,"output"],[38,16,27,16],[38,19,27,19],[38,23,27,23,"Uint8Array"],[38,33,27,33],[38,34,27,34,"byteLength"],[38,44,27,44],[38,45,27,45],[39,4,28,4],[39,10,28,10,"bn"],[39,12,28,12],[39,15,28,15,"isNegative"],[39,25,28,25],[39,28,29,10,"valueBn"],[39,35,29,17],[39,36,29,18,"toTwos"],[39,42,29,24],[39,43,29,25,"byteLength"],[39,53,29,35],[39,56,29,38],[39,57,29,39],[39,58,29,40],[39,61,30,10,"valueBn"],[39,68,30,17],[40,4,31,4,"output"],[40,10,31,10],[40,11,31,11,"set"],[40,14,31,14],[40,15,31,15,"bn"],[40,17,31,17],[40,18,31,18,"toArray"],[40,25,31,25],[40,26,31,26,"isLe"],[40,30,31,30],[40,33,31,33],[40,37,31,37],[40,40,31,40],[40,44,31,44],[40,46,31,46,"byteLength"],[40,56,31,56],[40,57,31,57],[40,59,31,59],[40,60,31,60],[40,61,31,61],[41,4,32,4],[41,11,32,11,"output"],[41,17,32,17],[42,2,33,0],[43,0,33,1],[43,3]],"functionMap":{"names":["<global>","bnToU8a"],"mappings":"AAA;OCgB;CDgB"},"hasCjsExports":false},"type":"js/module"}]} |