types: block json unmarshal method added

This commit is contained in:
obscuren
2015-05-31 15:53:17 +02:00
parent fa4aefee44
commit b26f5e0bb7
3 changed files with 30 additions and 6 deletions

View File

@ -36,16 +36,16 @@ func Big(num string) *big.Int {
return n
}
// BigD
// Bytes2Big
//
// Shortcut for new(big.Int).SetBytes(...)
func Bytes2Big(data []byte) *big.Int {
func BytesToBig(data []byte) *big.Int {
n := new(big.Int)
n.SetBytes(data)
return n
}
func BigD(data []byte) *big.Int { return Bytes2Big(data) }
func Bytes2Big(data []byte) *big.Int { return BytesToBig(data) }
func BigD(data []byte) *big.Int { return BytesToBig(data) }
func String2Big(num string) *big.Int {
n := new(big.Int)