Beispiel #1
0
        public static string PubkeyHashToAddress(byte[] publicHash)
        {
            Sha3Keccack sha3Keccack = Sha3Keccack.Current;

            byte[] r1 = publicHash;
            byte[] r2 = Utils.prepend(r1, (byte)0x00);
            byte[] r3 = sha3Keccack.CalculateHash(sha3Keccack.CalculateHash(r1));
            byte[] b4 = Utils.CopyByteArray(r3, 0, 4);
            byte[] b5 = Utils.Combine(r2, b4);
            string s6 = "WX" + Base58Check.Encode(b5);

            return(s6);
        }
Beispiel #2
0
 public void TestBase58WithEverything()
 {
     Assert.Equal("5T", Base58Check.Encode(new byte[] { 0x01, 0x02 }));
     Assert.Equal(new byte[] { 0x01, 0x02 }, Base58Check.Decode("5T"));
 }