Exemple #1
0
 public Address(Byte[] data, Byte version)
 {
     SHA256 sha256 = new SHA256Managed();
     RIPEMD160 ripemd160 = new RIPEMD160Managed();
     switch (version)
     {
         case PUBKEY:
             pubKeyHash = ripemd160.ComputeHash(sha256.ComputeHash(data));
             break;
         case PUBKEYHASH:
             pubKeyHash = data;
             break;
         case SCRIPTHASH:
             scriptHash = data;
             break;
     }
 }
Exemple #2
0
 private Byte calcHash()
 {
     Byte version;
     Byte[] hash = Base58CheckString.ToByteArray(address, out version);
     switch (version)
     {
         case PUBKEYHASH:
             pubKeyHash = hash;
             break;
         case SCRIPTHASH:
             scriptHash = hash;
             break;
     }
     return version;
 }