diff options
Diffstat (limited to 'ethutil/big.go')
-rw-r--r-- | ethutil/big.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ethutil/big.go b/ethutil/big.go index 2ff1c72d8..b77e0af8c 100644 --- a/ethutil/big.go +++ b/ethutil/big.go @@ -25,12 +25,19 @@ func Big(num string) *big.Int { // BigD // // Shortcut for new(big.Int).SetBytes(...) -func BigD(data []byte) *big.Int { +func Bytes2Big(data []byte) *big.Int { n := new(big.Int) n.SetBytes(data) return n } +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 |