title: javascript bigint conversion
body: <p>To represent balance as u128, we assume that the smallest decimal is 15. i.e the smallest unit is  1e-15. Now, I need the following functionalities:</p>
  <p>(1) convert between float to big number integer e.g. 0.001$ is 0.001*1e15=1e12 as bignumber integer.</p>
  <p>(2) convert the balance into byte array, either big endian or small endian, so that I can sign on it.</p>
  <p>The library I used before is &quot;bn.js&quot;. It supports (2), however, if I want to convert 1000$ as bigint by using:</p>
  <pre><code>let amt = new BN(1e18, 10)
  </code></pre>
  <p>I will get error, because bn.js requires the number to be less than 2^53, but 1e18&gt;2^53. This is just against the point of big number! Here is the link to this restriction:
  <a href="https://github.com/indutny/bn.js/blob/master/lib/bn.js#L128" rel="nofollow noreferrer">https://github.com/indutny/bn.js/blob/master/lib/bn.js#L128</a></p>
  <p>There are some other libraries such as bignumber.js I check, but they doesn't support (2).</p>