mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 11:11:01 +00:00
1 line
4.9 KiB
Plaintext
1 line
4.9 KiB
Plaintext
{"dependencies":[{"name":"@polkadot/x-bigint","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":4,"column":19,"index":119},"end":{"line":4,"column":48,"index":148}}],"key":"vYT44QPz4/mwSlaWVHyJIDa5mP4=","exportNames":["*"],"imports":1}},{"name":"./consts.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":20,"index":170},"end":{"line":5,"column":42,"index":192}}],"key":"VesxYcVBBj0aFn0MBycvi0lQp6U=","exportNames":["*"],"imports":1}},{"name":"./toBigInt.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":22,"index":216},"end":{"line":6,"column":46,"index":240}}],"key":"dTHcSVsvfdaQVo2r9WMgAXLmXhU=","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.nSqrt = nSqrt;\n const x_bigint_1 = require(_dependencyMap[0], \"@polkadot/x-bigint\");\n const consts_js_1 = require(_dependencyMap[1], \"./consts.js\");\n const toBigInt_js_1 = require(_dependencyMap[2], \"./toBigInt.js\");\n /**\n * @name nSqrt\n * @summary Calculates the integer square root of a bigint\n */\n function nSqrt(value) {\n const n = (0, toBigInt_js_1.nToBigInt)(value);\n if (n < consts_js_1._0n) {\n throw new Error('square root of negative numbers is not supported');\n }\n // https://stackoverflow.com/questions/53683995/javascript-big-integer-square-root/\n // shortcut <= 2^53 - 1 to use the JS utils\n if (n <= consts_js_1._2pow53n) {\n // ~~ is more performant that Math.floor\n return (0, x_bigint_1.BigInt)(~~Math.sqrt(Number(n)));\n }\n // Use sqrt(MAX_SAFE_INTEGER) as starting point. since we already know the\n // output will be larger than this, we expect this to be a safe start\n let x0 = consts_js_1._sqrt2pow53n;\n while (true) {\n const x1 = n / x0 + x0 >> consts_js_1._1n;\n if (x0 === x1 || x0 === x1 - consts_js_1._1n) {\n return x0;\n }\n x0 = x1;\n }\n }\n});","lineCount":37,"map":[[2,2,1,0],[2,14,1,12],[4,2,2,0,"Object"],[4,8,2,6],[4,9,2,7,"defineProperty"],[4,23,2,21],[4,24,2,22,"exports"],[4,31,2,29],[4,33,2,31],[4,45,2,43],[4,47,2,45],[5,4,2,47,"value"],[5,9,2,52],[5,11,2,54],[6,2,2,59],[6,3,2,60],[6,4,2,61],[7,2,3,0,"exports"],[7,9,3,7],[7,10,3,8,"nSqrt"],[7,15,3,13],[7,18,3,16,"nSqrt"],[7,23,3,21],[8,2,4,0],[8,8,4,6,"x_bigint_1"],[8,18,4,16],[8,21,4,19,"require"],[8,28,4,26],[8,29,4,26,"_dependencyMap"],[8,43,4,26],[8,68,4,47],[8,69,4,48],[9,2,5,0],[9,8,5,6,"consts_js_1"],[9,19,5,17],[9,22,5,20,"require"],[9,29,5,27],[9,30,5,27,"_dependencyMap"],[9,44,5,27],[9,62,5,41],[9,63,5,42],[10,2,6,0],[10,8,6,6,"toBigInt_js_1"],[10,21,6,19],[10,24,6,22,"require"],[10,31,6,29],[10,32,6,29,"_dependencyMap"],[10,46,6,29],[10,66,6,45],[10,67,6,46],[11,2,7,0],[12,0,8,0],[13,0,9,0],[14,0,10,0],[15,2,11,0],[15,11,11,9,"nSqrt"],[15,16,11,14,"nSqrt"],[15,17,11,15,"value"],[15,22,11,20],[15,24,11,22],[16,4,12,4],[16,10,12,10,"n"],[16,11,12,11],[16,14,12,14],[16,15,12,15],[16,16,12,16],[16,18,12,18,"toBigInt_js_1"],[16,31,12,31],[16,32,12,32,"nToBigInt"],[16,41,12,41],[16,43,12,43,"value"],[16,48,12,48],[16,49,12,49],[17,4,13,4],[17,8,13,8,"n"],[17,9,13,9],[17,12,13,12,"consts_js_1"],[17,23,13,23],[17,24,13,24,"_0n"],[17,27,13,27],[17,29,13,29],[18,6,14,8],[18,12,14,14],[18,16,14,18,"Error"],[18,21,14,23],[18,22,14,24],[18,72,14,74],[18,73,14,75],[19,4,15,4],[20,4,16,4],[21,4,17,4],[22,4,18,4],[22,8,18,8,"n"],[22,9,18,9],[22,13,18,13,"consts_js_1"],[22,24,18,24],[22,25,18,25,"_2pow53n"],[22,33,18,33],[22,35,18,35],[23,6,19,8],[24,6,20,8],[24,13,20,15],[24,14,20,16],[24,15,20,17],[24,17,20,19,"x_bigint_1"],[24,27,20,29],[24,28,20,30,"BigInt"],[24,34,20,36],[24,36,20,38],[24,37,20,39],[24,38,20,40,"Math"],[24,42,20,44],[24,43,20,45,"sqrt"],[24,47,20,49],[24,48,20,50,"Number"],[24,54,20,56],[24,55,20,57,"n"],[24,56,20,58],[24,57,20,59],[24,58,20,60],[24,59,20,61],[25,4,21,4],[26,4,22,4],[27,4,23,4],[28,4,24,4],[28,8,24,8,"x0"],[28,10,24,10],[28,13,24,13,"consts_js_1"],[28,24,24,24],[28,25,24,25,"_sqrt2pow53n"],[28,37,24,37],[29,4,25,4],[29,11,25,11],[29,15,25,15],[29,17,25,17],[30,6,26,8],[30,12,26,14,"x1"],[30,14,26,16],[30,17,26,21,"n"],[30,18,26,22],[30,21,26,25,"x0"],[30,23,26,27],[30,26,26,31,"x0"],[30,28,26,33],[30,32,26,38,"consts_js_1"],[30,43,26,49],[30,44,26,50,"_1n"],[30,47,26,53],[31,6,27,8],[31,10,27,12,"x0"],[31,12,27,14],[31,17,27,19,"x1"],[31,19,27,21],[31,23,27,26,"x0"],[31,25,27,28],[31,30,27,34,"x1"],[31,32,27,36],[31,35,27,39,"consts_js_1"],[31,46,27,50],[31,47,27,51,"_1n"],[31,50,27,56],[31,52,27,58],[32,8,28,12],[32,15,28,19,"x0"],[32,17,28,21],[33,6,29,8],[34,6,30,8,"x0"],[34,8,30,10],[34,11,30,13,"x1"],[34,13,30,15],[35,4,31,4],[36,2,32,0],[37,0,32,1],[37,3]],"functionMap":{"names":["<global>","nSqrt"],"mappings":"AAA;ACU;CDqB"},"hasCjsExports":true},"type":"js/module"}]} |