summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/bn.js13
-rw-r--r--test/bn_test.js2
2 files changed, 6 insertions, 9 deletions
diff --git a/core/bn.js b/core/bn.js
index 181f125..4755f70 100644
--- a/core/bn.js
+++ b/core/bn.js
@@ -88,15 +88,12 @@ sjcl.bn.prototype = {
/**
* Convert to a hex string.
*/
- toString: function(doTrim) {
- var i, s, l, out = new sjcl.bn(this);
- out.fullReduce();
- doTrim && out.trim();
- l = out.limbs;
- out = "";
- for (i=0; i < l.length; i++) {
+ toString: function() {
+ this.fullReduce();
+ var out="", i, s, l = this.limbs;
+ for (i=0; i < this.limbs.length; i++) {
s = l[i].toString(16);
- while (i < l.length - 1 && s.length < 6) {
+ while (i < this.limbs.length - 1 && s.length < 6) {
s = "0" + s;
}
out = s + out;
diff --git a/test/bn_test.js b/test/bn_test.js
index 0f03554..a669991 100644
--- a/test/bn_test.js
+++ b/test/bn_test.js
@@ -72,7 +72,7 @@ new sjcl.test.TestCase("Bignum toString test", function (cb) {
cb && cb();
return;
}
- this.require((new sjcl.bn(12312434)).power(10).toString(true) ===
+ this.require((new sjcl.bn(12312434)).power(10).toString() ===
'0xb99c06973dcc72429aa1dd41b0bc40a424289a05d3d72f066ee4e71c400');
cb && cb();
});