Move Big* vars to big.go

This commit is contained in:
Taylor Gerring 2015-03-22 13:46:38 +01:00
parent 2477d10aa0
commit 360c66c65d
2 changed files with 13 additions and 14 deletions

View File

@ -2,6 +2,19 @@ package common
import "math/big" import "math/big"
// Common big integers often used
var (
Big1 = big.NewInt(1)
Big2 = big.NewInt(2)
Big3 = big.NewInt(3)
Big0 = big.NewInt(0)
BigTrue = Big1
BigFalse = Big0
Big32 = big.NewInt(32)
Big256 = big.NewInt(0xff)
Big257 = big.NewInt(257)
)
// Big pow // Big pow
// //
// Returns the power of two big integers // Returns the power of two big integers

View File

@ -2,23 +2,9 @@ package common
import ( import (
"fmt" "fmt"
"math/big"
"time" "time"
) )
// Common big integers often used
var (
Big1 = big.NewInt(1)
Big2 = big.NewInt(2)
Big3 = big.NewInt(3)
Big0 = big.NewInt(0)
BigTrue = Big1
BigFalse = Big0
Big32 = big.NewInt(32)
Big256 = big.NewInt(0xff)
Big257 = big.NewInt(257)
)
func Bench(pre string, cb func()) { func Bench(pre string, cb func()) {
start := time.Now() start := time.Now()
cb() cb()