예제 #1
0
        public static string PubkeyToAddress(byte[] pubkey)
        {
            Sha3Keccack sha3Keccack = Sha3Keccack.Current;

            byte[] pub256 = sha3Keccack.CalculateHash(pubkey);
            byte[] r1     = RipemdManager.getHash(pub256);
            return(PubkeyHashToAddress(r1));
        }
 public void TestRipemd160WithEverything()
 {
     Assert.Equal("189f7c8b1a386ffe8eed91b3830c7a7bcd1e778c", RipemdManager.getHash(new byte[] { 0x01, 0x02 }).ToHex());
 }
예제 #3
0
 public static string PublicKeyToPublicKeyHash(string publicKey)
 {
     byte[] pub256 = Sha3Keccack.Current.CalculateHash(publicKey.HexToByteArray());
     byte[] r1     = RipemdManager.getHash(pub256);
     return(r1.ToHex());
 }