aboutsummaryrefslogtreecommitdiffstats
path: root/ethcrypto/crypto.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-06-29 23:08:33 +0800
committerzelig <viktor.tron@gmail.com>2014-06-29 23:08:33 +0800
commite3b911652dfba1475001137ba8b3687b9fec5331 (patch)
treeebc5d9088746338bbe3fb91703de3c5895a7833b /ethcrypto/crypto.go
parent5e50b50dc379ed1db48912538034414ff94f6531 (diff)
downloadgo-tangerine-e3b911652dfba1475001137ba8b3687b9fec5331.tar
go-tangerine-e3b911652dfba1475001137ba8b3687b9fec5331.tar.gz
go-tangerine-e3b911652dfba1475001137ba8b3687b9fec5331.tar.bz2
go-tangerine-e3b911652dfba1475001137ba8b3687b9fec5331.tar.lz
go-tangerine-e3b911652dfba1475001137ba8b3687b9fec5331.tar.xz
go-tangerine-e3b911652dfba1475001137ba8b3687b9fec5331.tar.zst
go-tangerine-e3b911652dfba1475001137ba8b3687b9fec5331.zip
move CreateAddress from ethutil/common to ethcrypto
Diffstat (limited to 'ethcrypto/crypto.go')
-rw-r--r--ethcrypto/crypto.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/ethcrypto/crypto.go b/ethcrypto/crypto.go
index 9c4013d6c..b341915eb 100644
--- a/ethcrypto/crypto.go
+++ b/ethcrypto/crypto.go
@@ -25,3 +25,10 @@ func Sha3Bin(data []byte) []byte {
return d.Sum(nil)
}
+
+// Creates an ethereum address given the bytes and the nonce
+func CreateAddress(b []byte, nonce *big.Int) []byte {
+ addrBytes := append(b, nonce.Bytes()...)
+
+ return Sha3Bin(addrBytes)[12:]
+}