aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/big.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-10 08:22:38 +0800
committerobscuren <geffobscura@gmail.com>2015-03-10 08:22:38 +0800
commit0db4a0e898d09ffa7b6b1289e9a334edc0001cfa (patch)
treea0b5c8381ab482550ef4800a06d4db086d76a983 /ethutil/big.go
parent94e543bc398efbb5c712b6e4cb48d8a57eb3400d (diff)
parent0d64163fea3a266ceb71cb4c4ee5682052c9ca6c (diff)
downloaddexon-0db4a0e898d09ffa7b6b1289e9a334edc0001cfa.tar
dexon-0db4a0e898d09ffa7b6b1289e9a334edc0001cfa.tar.gz
dexon-0db4a0e898d09ffa7b6b1289e9a334edc0001cfa.tar.bz2
dexon-0db4a0e898d09ffa7b6b1289e9a334edc0001cfa.tar.lz
dexon-0db4a0e898d09ffa7b6b1289e9a334edc0001cfa.tar.xz
dexon-0db4a0e898d09ffa7b6b1289e9a334edc0001cfa.tar.zst
dexon-0db4a0e898d09ffa7b6b1289e9a334edc0001cfa.zip
Merge branch 'poc-9' into develop
Diffstat (limited to 'ethutil/big.go')
-rw-r--r--ethutil/big.go9
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