peterolson / BigInteger.js

An arbitrary length integer library for Javascript
The Unlicense
1.12k stars 187 forks source link

How to get value of Integer object? #187

Closed 0xrisec closed 5 years ago

0xrisec commented 5 years ago

code:>>>>>>>>>>>>>>>>>>>>>>>>

var bigInt = require("big-integer"); let e=65537; let n=667; let m = 18; function enc(m, n, e) { let c = bigInt(m).modPow(e, n); console.log(c); }; enc(m,n,e);

code:>>>>>>>>>>>>>>>>>>>>>>

output>>>>>>>>>>>>>>>>>>>>>>> Integer { value: 55n } output>>>>>>>>>>>>>>>>>>>>>>>

sir, I want output 55. but i am getting Integer { value: 55n }. what should i add some code to get output 55.

expected Output>>>>>>>>>>>>>>>>>>> 55 expected Output>>>>>>>>>>>>>>>>>>>

peterolson commented 5 years ago

Just do c.toString()

0xrisec commented 5 years ago

thanx