aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/big.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-10 00:55:01 +0800
committerobscuren <geffobscura@gmail.com>2015-03-10 00:55:01 +0800
commit8560004f380dc688a1171ad5aeffa593aae41193 (patch)
treefea395acf042b51e97a86e2c4cbcf8c16b2912b7 /ethutil/big.go
parent9723191b19f6ddc12f0c3376ede7529b2d72e6a2 (diff)
parent676a0de58d3d7c508b0eeeff192d2095a46f7382 (diff)
downloaddexon-8560004f380dc688a1171ad5aeffa593aae41193.tar
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.gz
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.bz2
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.lz
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.xz
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.zst
dexon-8560004f380dc688a1171ad5aeffa593aae41193.zip
wip
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