Ejemplo n.º 1
0
        private static UInt256 GetMessageHash(ReadOnlyByteSpan message)
        {
            var messageHash = message.Sha256().ToHex();

            return(new HashWriter().Add(MessageMagic).Add(messageHash).GetHashFinal());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Computes RIPEMD160 of SHA256 of data: RIPEMD160(SHA256(data))
        /// </summary>
        /// <param name="data">Input: bytes to be hashed.</param>
        /// <param name="hash">Output: RIPEMD160 of SHA256 of data.</param>
        public static void Hash160(this ReadOnlyByteSpan data, ByteSpan hash)
        {
            var x = data.Sha256();

            Ripemd160(x.Span, hash);
        }