mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "common: remove address.Hash footgun (#28228)"
This reverts commit 4502642810.
This commit is contained in:
parent
15c902b231
commit
e2ee6dc86f
1 changed files with 3 additions and 0 deletions
|
|
@ -239,6 +239,9 @@ func (a Address) Cmp(other Address) int {
|
|||
// Bytes gets the string representation of the underlying address.
|
||||
func (a Address) Bytes() []byte { return a[:] }
|
||||
|
||||
// Hash converts an address to a hash by left-padding it with zeros.
|
||||
func (a Address) Hash() Hash { return BytesToHash(a[:]) }
|
||||
|
||||
// Big converts an address to a big integer.
|
||||
func (a Address) Big() *big.Int { return new(big.Int).SetBytes(a[:]) }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue