mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 14:31:02 +00:00
1 line
5.0 KiB
Plaintext
1 line
5.0 KiB
Plaintext
{"dependencies":[{"name":"./sshash.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":37,"index":37}}],"key":"iAW3BPkeW4gOhrHer7UhHNL+K9k=","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.checkAddressChecksum = checkAddressChecksum;\n var _sshashJs = require(_dependencyMap[0], \"./sshash.js\");\n function checkAddressChecksum(decoded) {\n const ss58Length = decoded[0] & 0b0100_0000 ? 2 : 1;\n const ss58Decoded = ss58Length === 1 ? decoded[0] : (decoded[0] & 0b0011_1111) << 2 | decoded[1] >> 6 | (decoded[1] & 0b0011_1111) << 8;\n // 32/33 bytes public + 2 bytes checksum + prefix\n const isPublicKey = [34 + ss58Length, 35 + ss58Length].includes(decoded.length);\n const length = decoded.length - (isPublicKey ? 2 : 1);\n // calculate the hash and do the checksum byte checks\n const hash = (0, _sshashJs.sshash)(decoded.subarray(0, length));\n const isValid = (decoded[0] & 0b1000_0000) === 0 && ![46, 47].includes(decoded[0]) && (isPublicKey ? decoded[decoded.length - 2] === hash[0] && decoded[decoded.length - 1] === hash[1] : decoded[decoded.length - 1] === hash[0]);\n return [isValid, length, ss58Length, ss58Decoded];\n }\n});","lineCount":20,"map":[[7,2,2,0,"exports"],[7,9,2,0],[7,10,2,0,"checkAddressChecksum"],[7,30,2,0],[7,33,2,0,"checkAddressChecksum"],[7,53,2,0],[8,2,1,0],[8,6,1,0,"_sshashJs"],[8,15,1,0],[8,18,1,0,"require"],[8,25,1,0],[8,26,1,0,"_dependencyMap"],[8,40,1,0],[9,2,2,7],[9,11,2,16,"checkAddressChecksum"],[9,31,2,36,"checkAddressChecksum"],[9,32,2,37,"decoded"],[9,39,2,44],[9,41,2,46],[10,4,3,4],[10,10,3,10,"ss58Length"],[10,20,3,20],[10,23,3,24,"decoded"],[10,30,3,31],[10,31,3,32],[10,32,3,33],[10,33,3,34],[10,36,3,37],[10,47,3,48],[10,50,3,52],[10,51,3,53],[10,54,3,56],[10,55,3,57],[11,4,4,4],[11,10,4,10,"ss58Decoded"],[11,21,4,21],[11,24,4,24,"ss58Length"],[11,34,4,34],[11,39,4,39],[11,40,4,40],[11,43,5,10,"decoded"],[11,50,5,17],[11,51,5,18],[11,52,5,19],[11,53,5,20],[11,56,6,11],[11,57,6,12,"decoded"],[11,64,6,19],[11,65,6,20],[11,66,6,21],[11,67,6,22],[11,70,6,25],[11,81,6,36],[11,86,6,41],[11,87,6,42],[11,90,6,47,"decoded"],[11,97,6,54],[11,98,6,55],[11,99,6,56],[11,100,6,57],[11,104,6,61],[11,105,6,63],[11,108,6,67],[11,109,6,68,"decoded"],[11,116,6,75],[11,117,6,76],[11,118,6,77],[11,119,6,78],[11,122,6,81],[11,133,6,92],[11,138,6,97],[11,139,6,99],[12,4,7,4],[13,4,8,4],[13,10,8,10,"isPublicKey"],[13,21,8,21],[13,24,8,24],[13,25,8,25],[13,27,8,27],[13,30,8,30,"ss58Length"],[13,40,8,40],[13,42,8,42],[13,44,8,44],[13,47,8,47,"ss58Length"],[13,57,8,57],[13,58,8,58],[13,59,8,59,"includes"],[13,67,8,67],[13,68,8,68,"decoded"],[13,75,8,75],[13,76,8,76,"length"],[13,82,8,82],[13,83,8,83],[14,4,9,4],[14,10,9,10,"length"],[14,16,9,16],[14,19,9,19,"decoded"],[14,26,9,26],[14,27,9,27,"length"],[14,33,9,33],[14,37,9,37,"isPublicKey"],[14,48,9,48],[14,51,9,51],[14,52,9,52],[14,55,9,55],[14,56,9,56],[14,57,9,57],[15,4,10,4],[16,4,11,4],[16,10,11,10,"hash"],[16,14,11,14],[16,17,11,17],[16,21,11,17,"sshash"],[16,30,11,23],[16,31,11,23,"sshash"],[16,37,11,23],[16,39,11,24,"decoded"],[16,46,11,31],[16,47,11,32,"subarray"],[16,55,11,40],[16,56,11,41],[16,57,11,42],[16,59,11,44,"length"],[16,65,11,50],[16,66,11,51],[16,67,11,52],[17,4,12,4],[17,10,12,10,"isValid"],[17,17,12,17],[17,20,12,20],[17,21,12,21,"decoded"],[17,28,12,28],[17,29,12,29],[17,30,12,30],[17,31,12,31],[17,34,12,34],[17,45,12,45],[17,51,12,51],[17,52,12,52],[17,56,12,56],[17,57,12,57],[17,58,12,58],[17,60,12,60],[17,62,12,62],[17,64,12,64],[17,65,12,65],[17,66,12,66,"includes"],[17,74,12,74],[17,75,12,75,"decoded"],[17,82,12,82],[17,83,12,83],[17,84,12,84],[17,85,12,85],[17,86,12,86],[17,91,12,91,"isPublicKey"],[17,102,12,102],[17,105,13,10,"decoded"],[17,112,13,17],[17,113,13,18,"decoded"],[17,120,13,25],[17,121,13,26,"length"],[17,127,13,32],[17,130,13,35],[17,131,13,36],[17,132,13,37],[17,137,13,42,"hash"],[17,141,13,46],[17,142,13,47],[17,143,13,48],[17,144,13,49],[17,148,13,53,"decoded"],[17,155,13,60],[17,156,13,61,"decoded"],[17,163,13,68],[17,164,13,69,"length"],[17,170,13,75],[17,173,13,78],[17,174,13,79],[17,175,13,80],[17,180,13,85,"hash"],[17,184,13,89],[17,185,13,90],[17,186,13,91],[17,187,13,92],[17,190,14,10,"decoded"],[17,197,14,17],[17,198,14,18,"decoded"],[17,205,14,25],[17,206,14,26,"length"],[17,212,14,32],[17,215,14,35],[17,216,14,36],[17,217,14,37],[17,222,14,42,"hash"],[17,226,14,46],[17,227,14,47],[17,228,14,48],[17,229,14,49],[17,230,14,50],[18,4,15,4],[18,11,15,11],[18,12,15,12,"isValid"],[18,19,15,19],[18,21,15,21,"length"],[18,27,15,27],[18,29,15,29,"ss58Length"],[18,39,15,39],[18,41,15,41,"ss58Decoded"],[18,52,15,52],[18,53,15,53],[19,2,16,0],[20,0,16,1],[20,3]],"functionMap":{"names":["<global>","checkAddressChecksum"],"mappings":"AAA;OCC;CDc"},"hasCjsExports":false},"type":"js/module"}]} |