コード例 #1
0
 public bool Equals(Hash256 other)
 {
     return(Equals(this, other));
 }
コード例 #2
0
 public static bool Equals(Hash256 left, Hash256 right)
 {
     return(left.Bytes.SequenceEqual(right.Bytes));
 }
コード例 #3
0
 /// <summary>
 /// Sets a hash from a hex hash in a string representation
 /// </summary>
 /// <param name="hash">input hash</param>
 /// <param name="hexHash">hash hex value as a string</param>
 /// <returns>the hash</returns>
 public static Hash256 Set(this Hash256 hash, string hexHash)
 {
     hash.Bytes = hexHash.HexToBytes();
     return(hash);
 }
コード例 #4
0
        /// <summary>
        /// Peforms a RIPEMD160 hash on the hash
        /// </summary>
        /// <param name="hash">input hash</param>
        /// <returns>RIPEMD160 hash of the hash</returns>
        public static Hash160 RIPEMD160(this Hash256 hash)
        {
            MsftHasher hasher = new MsftHasher();

            return(hasher.RIPEMD160(hash));
        }
コード例 #5
0
 /// <summary>
 /// Converts a hash to a hex in a string representation
 /// </summary>
 /// <param name="hash">the hash to convert</param>
 /// <returns>the hash in hex</returns>
 public static string ToHexString(this Hash256 hash)
 {
     return(hash.Bytes.ToHexString());
 }