diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-06 00:21:16 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-06 00:21:16 +0800 |
commit | fabaf4f1f01db773f6c0c2e9a9499736b1a40848 (patch) | |
tree | 1261024e3b79bf304a111cb85f1409d3cd6fbd04 /ethutil/big.go | |
parent | c47866d25174bd783ee6bcd5b400d81d7bf598bb (diff) | |
download | dexon-fabaf4f1f01db773f6c0c2e9a9499736b1a40848.tar dexon-fabaf4f1f01db773f6c0c2e9a9499736b1a40848.tar.gz dexon-fabaf4f1f01db773f6c0c2e9a9499736b1a40848.tar.bz2 dexon-fabaf4f1f01db773f6c0c2e9a9499736b1a40848.tar.lz dexon-fabaf4f1f01db773f6c0c2e9a9499736b1a40848.tar.xz dexon-fabaf4f1f01db773f6c0c2e9a9499736b1a40848.tar.zst dexon-fabaf4f1f01db773f6c0c2e9a9499736b1a40848.zip |
wip math
Diffstat (limited to 'ethutil/big.go')
-rw-r--r-- | ethutil/big.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ethutil/big.go b/ethutil/big.go index 1716a7ce3..b77e0af8c 100644 --- a/ethutil/big.go +++ b/ethutil/big.go @@ -33,6 +33,12 @@ func Bytes2Big(data []byte) *big.Int { } func BigD(data []byte) *big.Int { return Bytes2Big(data) } +func String2Big(num string) *big.Int { + n := new(big.Int) + n.SetString(num, 0) + return n +} + func BitTest(num *big.Int, i int) bool { return num.Bit(i) > 0 } |