aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/big.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil/big.go')
-rw-r--r--ethutil/big.go6
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
}