From c47866d25174bd783ee6bcd5b400d81d7bf598bb Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 5 Mar 2015 09:14:58 +0100 Subject: Miner fixes and updates (including miner) --- ethutil/big.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ethutil/big.go') diff --git a/ethutil/big.go b/ethutil/big.go index 2ff1c72d8..1716a7ce3 100644 --- a/ethutil/big.go +++ b/ethutil/big.go @@ -25,12 +25,13 @@ 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 BitTest(num *big.Int, i int) bool { return num.Bit(i) > 0 -- cgit v1.2.3 From fabaf4f1f01db773f6c0c2e9a9499736b1a40848 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 5 Mar 2015 17:21:16 +0100 Subject: wip math --- ethutil/big.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ethutil/big.go') 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 } -- cgit v1.2.3