From 9294bc3e95633f1ed81a88471bedddbcba8587b2 Mon Sep 17 00:00:00 2001 From: jgabios Date: Wed, 28 May 2014 08:41:10 +0300 Subject: [PATCH] make bigInt work in bin() and hex() functions --- eth/ethString.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/ethString.js b/eth/ethString.js index bca4fe100..8722ffc92 100644 --- a/eth/ethString.js +++ b/eth/ethString.js @@ -35,7 +35,7 @@ String.prototype.bin = function() { bytes.push(parseInt(this.substr(i, 2), 16)); return String.fromCharCode.apply(String, bytes); } else if (/^\d+$/.test(this)) - return bigInt(this).toHex().bin() + return bigInt(this.substr(0)).toHex().bin() // Otherwise we'll return the "String" object instead of an actual string return this.substr(0, this.length) @@ -56,7 +56,7 @@ String.prototype.dec = function() { } String.prototype.hex = function() { - return bigInt(this).toHex() + return bigInt(this.substr(0)).toHex() }