aboutsummaryrefslogtreecommitdiffstats
path: root/ethcrypto/crypto.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-07-03 22:08:13 +0800
committerzelig <viktor.tron@gmail.com>2014-07-03 22:08:13 +0800
commitde2da4fd19b53a541ffbddfa4360ceabef14f1a9 (patch)
treee1895a115645ae46b33ed33f5fcc148a1cd1a288 /ethcrypto/crypto.go
parent198e5eeab9e2a7c359c12cdd5c8782dc56ae54ec (diff)
parent5d6713920625b82df2b55728b2cbb9f7f3df2025 (diff)
downloaddexon-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.go8
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:]
}