diff options
Diffstat (limited to 'node_modules/bn.js/README.md')
-rw-r--r-- | node_modules/bn.js/README.md | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/node_modules/bn.js/README.md b/node_modules/bn.js/README.md index fee65baad..370f06d21 100644 --- a/node_modules/bn.js/README.md +++ b/node_modules/bn.js/README.md @@ -40,12 +40,12 @@ is the list of them in the order of appearance in the function name: The only available postfix at the moment is: * `n` - which means that the argument of the function must be a plain JavaScript - number + Number. Decimals are not supported. ### Examples * `a.iadd(b)` - perform addition on `a` and `b`, storing the result in `a` -* `a.pmod(b)` - reduce `a` modulo `b`, returning positive value +* `a.umod(b)` - reduce `a` modulo `b`, returning positive value * `a.iushln(13)` - shift bits of `a` left by 13 ## Instructions @@ -63,7 +63,9 @@ either `le` (little-endian) or `be` (big-endian). pad to length, throwing if already exceeding * `a.toArrayLike(type, endian, length)` - convert to an instance of `type`, which must behave like an `Array` -* `a.toBuffer(endian, length)` - convert to Node.js Buffer (if available) +* `a.toBuffer(endian, length)` - convert to Node.js Buffer (if available). For + compatibility with browserify and similar tools, use this instead: + `a.toArrayLike(Buffer, endian, length)` * `a.bitLength()` - get number of bits occupied * `a.zeroBits()` - return number of less-significant consequent zero bits (example: `1010000` has 4 zero bits) @@ -81,7 +83,7 @@ either `le` (little-endian) or `be` (big-endian). * `a.eq(b)` - `a` equals `b` (`n`) * `a.toTwos(width)` - convert to two's complement representation, where `width` is bit width * `a.fromTwos(width)` - convert from two's complement representation, where `width` is the bit width -* `a.isBN(object)` - returns true if the supplied `object` is a BN.js instance +* `BN.isBN(object)` - returns true if the supplied `object` is a BN.js instance ### Arithmetics @@ -150,7 +152,7 @@ Or: var red = BN.mont(num); ``` -To reduce numbers with [Montgomery trick][1]. `.mont()` is generally faster than +To reduce numbers with [Montgomery trick][0]. `.mont()` is generally faster than `.red(num)`, but slower than `BN.red(primeName)`. ### Converting numbers |