Remove Hash, Hash256, Hash160 and ScryptHash256 classes.
[NovacoinLibrary.git] / Novacoin / CKeyID.cs
index d7130a8..be51bf1 100644 (file)
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-using System;
-using System.Diagnostics.Contracts;
-
 namespace Novacoin
 {
-    public class CKeyID : Hash160
+    /// <summary>
+    /// Represents the key identifier. Internal state is calculated as Hash160(pubkey).
+    /// </summary>
+    public class CKeyID : uint160
     {
-        public CKeyID(Hash160 pubKeyHash)
+        #region Constructors
+        public CKeyID() : base()
+        {
+        }
+
+        public CKeyID(CKeyID KeyID) : base(KeyID as uint160)
         {
-            _hashBytes = pubKeyHash;
         }
 
-        internal CKeyID(byte[] hashBytes)
+        public CKeyID(uint160 pubKeyHash) : base(pubKeyHash)
         {
-            Contract.Requires<ArgumentException>(hashBytes.Length == 20, "Your data doesn't seem like a hash160 of some value.");
+        }
 
-            _hashBytes = hashBytes;
+        public CKeyID(byte[] hashBytes) : base(hashBytes)
+        {
         }
+        #endregion
 
+        /// <summary>
+        /// Generate Pay-to-PubkeyHash address
+        /// </summary>
+        /// <returns>Base58 formatted novacoin address</returns>
         public override string ToString()
         {
             return (new CNovacoinAddress(this)).ToString();