How to use the jsbn/lib/big-integer.fromInt function in jsbn

To help you get started, we’ve selected a few jsbn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wowserhq / wowser / src / lib / crypto / big-num.js View on Github external
constructor(value, radix) {
    if (typeof value === 'number') {
      this._bi = BigInteger.fromInt(value);
    } else if (value.constructor === BigInteger) {
      this._bi = value;
    } else if (value.constructor === BigNum) {
      this._bi = value.bi;
    } else {
      this._bi = new BigInteger(value, radix);
    }
  }
github wowserhq / wowser / lib / client / crypto / big-num.js View on Github external
function BigNum(value, radix) {
    _classCallCheck(this, BigNum);

    if (typeof value == 'number') {
      this._bi = BigInteger.fromInt(value);
    } else if (value.constructor == BigInteger) {
      this._bi = value;
    } else if (value.constructor == BigNum) {
      this._bi = value.bi;
    } else {
      this._bi = new BigInteger(value, radix);
    }
  }

jsbn

The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis