在js中并没有发现这个方法的定义, 请教大家这个方法是怎么来的? 并解释下含义, 谢!代码:
https://addons.mozilla.org/ZH-cn/seamonkey/files/browse/188894/file/components/scripts/lib-rsa.js#top

解决方案 »

  1.   

    完整的RSA类代码在上面的网址内可看到. 使用过RSA的高手肯定很熟悉了, 由于小弟对JS只是基本语言的层面, 并不了解JS的对象体系, 因此在这里求助下JS的高手.formNumber中BigInteger类的构造函数内调用的, 调用代码如下:// (public) Constructor
    function BigInteger(a, b, c) {
    if (a != null)
    if ("number" == typeof a)
    this.fromNumber(a, b, c);
    else if (b == null && "string" != typeof a)
    this.fromString(a, 256);
    else
    this.fromString(a, b);
    }
      

  2.   

    BigInteger.prototype.fromInt = bnpFromInt;
    BigInteger.prototype.fromString = bnpFromString;以上两个方法都在代码内有定义, 因此没有疑问,但fromNumber却是无中生有,有点恐怖。