summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/math/bindec.js.map
blob: 3787ca346bc6e055cdbb602fc10502c5087911ca (plain) (blame)
1
{"version":3,"sources":["../../../src/php/math/bindec.js"],"names":["module","exports","bindec","binaryString","replace","parseInt"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,YAAjB,EAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAA,iBAAe,CAACA,eAAe,EAAhB,EAAoBC,OAApB,CAA4B,SAA5B,EAAuC,EAAvC,CAAf;;AAEA,SAAOC,SAASF,YAAT,EAAuB,CAAvB,CAAP;AACD,CAbD","file":"bindec.js","sourcesContent":["module.exports = function bindec (binaryString) {\n  //  discuss at: http://locutus.io/php/bindec/\n  // original by: Philippe Baumann\n  //   example 1: bindec('110011')\n  //   returns 1: 51\n  //   example 2: bindec('000110011')\n  //   returns 2: 51\n  //   example 3: bindec('111')\n  //   returns 3: 7\n\n  binaryString = (binaryString + '').replace(/[^01]/gi, '')\n\n  return parseInt(binaryString, 2)\n}\n"]}