diff options
author | zelig <viktor.tron@gmail.com> | 2014-07-03 22:08:13 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-07-03 22:08:13 +0800 |
commit | de2da4fd19b53a541ffbddfa4360ceabef14f1a9 (patch) | |
tree | e1895a115645ae46b33ed33f5fcc148a1cd1a288 /ethcrypto/crypto.go | |
parent | 198e5eeab9e2a7c359c12cdd5c8782dc56ae54ec (diff) | |
parent | 5d6713920625b82df2b55728b2cbb9f7f3df2025 (diff) | |
download | dexon-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar dexon-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.gz dexon-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.bz2 dexon-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.lz dexon-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.xz dexon-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.zst dexon-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.zip |
Merge branch 'develop' of github.com:ethereum/eth-go into feature/clientid
Diffstat (limited to 'ethcrypto/crypto.go')
-rw-r--r-- | ethcrypto/crypto.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ethcrypto/crypto.go b/ethcrypto/crypto.go index 8cb0be88c..b4bb881a0 100644 --- a/ethcrypto/crypto.go +++ b/ethcrypto/crypto.go @@ -3,8 +3,8 @@ package ethcrypto import ( "code.google.com/p/go.crypto/ripemd160" "crypto/sha256" + "github.com/ethereum/eth-go/ethutil" "github.com/obscuren/sha3" - "math/big" ) func Sha256Bin(data []byte) []byte { @@ -28,8 +28,6 @@ func Sha3Bin(data []byte) []byte { } // 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:] +func CreateAddress(b []byte, nonce uint64) []byte { + return Sha3Bin(ethutil.NewValue([]interface{}{b, nonce}).Encode())[12:] } |