aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-01 09:14:55 +0800
committerobscuren <geffobscura@gmail.com>2014-11-01 09:14:55 +0800
commit3f90f7c89856f5d024eec1df535a4fc2871214c2 (patch)
tree8513bddf2539b6dfadca894092449abdbcd623a8 /ethutil
parentc8438979a9c5c73bf68a132d5fd0325863ab454b (diff)
downloaddexon-3f90f7c89856f5d024eec1df535a4fc2871214c2.tar
dexon-3f90f7c89856f5d024eec1df535a4fc2871214c2.tar.gz
dexon-3f90f7c89856f5d024eec1df535a4fc2871214c2.tar.bz2
dexon-3f90f7c89856f5d024eec1df535a4fc2871214c2.tar.lz
dexon-3f90f7c89856f5d024eec1df535a4fc2871214c2.tar.xz
dexon-3f90f7c89856f5d024eec1df535a4fc2871214c2.tar.zst
dexon-3f90f7c89856f5d024eec1df535a4fc2871214c2.zip
Signextend
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/big.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/ethutil/big.go b/ethutil/big.go
index bdcf86421..8d7b3fe70 100644
--- a/ethutil/big.go
+++ b/ethutil/big.go
@@ -34,6 +34,10 @@ func BigD(data []byte) *big.Int {
return n
}
+func BitTest(num *big.Int, i int) bool {
+ return num.Bit(i) > 0
+}
+
// To256
//
// "cast" the big int to a 256 big int (i.e., limit to)