X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=Novacoin%2FCKeyID.cs;h=be51bf1f980df663c5195ecff7355d2e2cd9f5aa;hb=1dcac5faa2b1477034f82466ffb16170fa2e9bb6;hp=d7130a8a3cfa7f4f4a551e5b0e6ec4d35080ddf2;hpb=f1846d8b19cb53634c26d0618fcceaa6111e12d2;p=NovacoinLibrary.git diff --git a/Novacoin/CKeyID.cs b/Novacoin/CKeyID.cs index d7130a8..be51bf1 100644 --- a/Novacoin/CKeyID.cs +++ b/Novacoin/CKeyID.cs @@ -16,25 +16,35 @@ * along with this program. If not, see . */ -using System; -using System.Diagnostics.Contracts; - namespace Novacoin { - public class CKeyID : Hash160 + /// + /// Represents the key identifier. Internal state is calculated as Hash160(pubkey). + /// + 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(hashBytes.Length == 20, "Your data doesn't seem like a hash160 of some value."); + } - _hashBytes = hashBytes; + public CKeyID(byte[] hashBytes) : base(hashBytes) + { } + #endregion + /// + /// Generate Pay-to-PubkeyHash address + /// + /// Base58 formatted novacoin address public override string ToString() { return (new CNovacoinAddress(this)).ToString();