GetHash() public static method

public static GetHash ( byte input ) : byte[]
input byte
return byte[]
Example #1
0
        /// <summary>
        /// Computes the hash value for the specified byte array.
        /// </summary>
        /// <param name="buffer">The input to compute the hash code for.</param>
        /// <returns>
        /// The computed hash code
        /// </returns>
        public byte[] ComputeHash(byte[] buffer)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer", "The input cannot be null.");
            }

            return(Md5.GetHash(this.Combine(this.m_outer, Md5.GetHash(this.Combine(this.m_inner, buffer)))));
        }
Example #2
0
        /// <summary>
        /// Initializes the key.
        /// </summary>
        /// <param name="key">The key.</param>
        private void InitializeKey(byte[] key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key", "The Key cannot be null.");
            }

            if (key.Length > BLOCK_SIZE)
            {
                this.m_Key = Md5.GetHash(key);
            }
            else
            {
                this.m_Key = key;
            }

            this.UpdateIOPadBuffers();
        }