我正在寻找一个处理真正(长、大、巨大、风暴)数字的数学解决方案。我还没有发现任何东西,但我不想认为这个问题目前还没有解决。我正在寻找一个简单的数字解决方案,例如 Microsoft Excel Precision(30 位小数)或 BigInteger (Java) 解决方案。当然是用Javascript。
在为 ElGamal 加密实现寻找大整数库时,我测试了多个库,结果如下:
我推荐这个: Tom Wu 的 jsbn.js (http://www-cs-students.stanford.edu/~tjw/jsbn/ http://www-cs-students.stanford.edu/~tjw/jsbn/)
Leemon Baird 的大整数库(http://www.leemon.com/crypto/BigInt.js http://www.leemon.com/crypto/BigInt.js)
大数.js (https://github.com/MikeMcl/bignumber.js https://github.com/MikeMcl/bignumber.js)
- 功能相当齐全
-
BUT:将非常大的数字从字符串转换为 BigNumber 对象会导致 INFINITY
JavaScript 的方案算术库(https://github.com/jtobey/javascript-bignum https://github.com/jtobey/javascript-bignum)
- JS-Scheme算术函数的实现
-
BUT:y= x^e mod n 没有函数
我还没有亲自测试过: 大数 (http://jsfromhell.com/classes/bignumber http://jsfromhell.com/classes/bignumber)
- 高精度计算功能
-
BUT:由于数字的内部表示为字符串,据说速度很慢
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)