Commit 7bdb45f839d00fd23e2821b96c8b2fbb316c7dcb
U256: fix reading hex prefixed numbers
Alex Beregszaszi committed on 8/24/2016, 1:12:46 AMParent: 9ab801b3372e1e99fdac810e1d108dffbf2dff34
Files changed
u256.js | changed |
u256.js | ||
---|---|---|
@@ -6,9 +6,9 @@ | ||
6 | 6 | // This is the case when data is copied from WASM |
7 | 7 | if (value instanceof Uint8Array) { |
8 | 8 | this._value = new BN(value, 16, 'le') |
9 | 9 | } else if ((typeof value === 'string') && ethUtil.isHexPrefixed(value)) { |
10 | - this._value = new BN(value, 16) | |
10 | + this._value = new BN(ethUtil.stripHexPrefix(value), 16) | |
11 | 11 | } else { |
12 | 12 | this._value = new BN(value, 10) |
13 | 13 | } |
14 | 14 | } |
Built with git-ssb-web