git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 7bdb45f839d00fd23e2821b96c8b2fbb316c7dcb

U256: fix reading hex prefixed numbers

Alex Beregszaszi committed on 8/24/2016, 1:12:46 AM
Parent: 9ab801b3372e1e99fdac810e1d108dffbf2dff34

Files changed

u256.jschanged
u256.jsView
@@ -6,9 +6,9 @@
66 // This is the case when data is copied from WASM
77 if (value instanceof Uint8Array) {
88 this._value = new BN(value, 16, 'le')
99 } else if ((typeof value === 'string') && ethUtil.isHexPrefixed(value)) {
10- this._value = new BN(value, 16)
10+ this._value = new BN(ethUtil.stripHexPrefix(value), 16)
1111 } else {
1212 this._value = new BN(value, 10)
1313 }
1414 }

Built with git-ssb-web