How to convert strings to bigInt in JavaScript

后端 未结 3 812
北海茫月
北海茫月 2021-02-05 19:25

I need to convert a string to BigInt like BigInteger in Javascript

Example

var reqId = \"78099864177253771992779766288266836166272662\";
var         


        
3条回答
  •  孤城傲影
    2021-02-05 20:16

    You can use a JavaScript lib called BigInteger.js for the purpose.it is an arbitrary-length integer library for Javascript, allows arithmetic operations on integers of unlimited size, notwithstanding memory and time limitations.This lib can be download from this link.Like var largeNumber = bigInt("75643564363473453456342378564387956906736546456235345"); You can find documentation of lib here https://www.npmjs.com/package/big-integer

提交回复
热议问题