mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
add StringToAddress method
This commit is contained in:
parent
fa2b341c9a
commit
944de1130a
1 changed files with 2 additions and 0 deletions
|
|
@ -177,6 +177,8 @@ func BytesToAddress(b []byte) Address {
|
|||
return a
|
||||
}
|
||||
|
||||
func StringToAddress(s string) Address { return BytesToAddress([]byte(s)) }
|
||||
|
||||
// BigToAddress returns Address with byte values of b.
|
||||
// If b is larger than len(h), b will be cropped from the left.
|
||||
func BigToAddress(b *big.Int) Address { return BytesToAddress(b.Bytes()) }
|
||||
|
|
|
|||
Loading…
Reference in a new issue