Beispiel #1
0
        /// <summary>
        ///   Returns a byte hash from the input byte
        /// </summary>
        /// <param name = "b">byte to hash</param>
        /// <returns>binary hash of the input byte</returns>
        public byte[] GetByteHashFromByte(byte b)
        {
            var md4 = new MD4();

            md4.EngineUpdate(b);

            return(md4.EngineDigest());
        }
Beispiel #2
0
        /// <summary>
        ///   Returns a binary hash from an input byte array
        /// </summary>
        /// <param name = "b">byte-array to hash</param>
        /// <returns>binary hash of input</returns>
        public byte[] GetByteHashFromBytes(byte[] b)
        {
            var md4 = new MD4();

            md4.EngineUpdate(b, 0, b.Length);

            return(md4.EngineDigest());
        }
Beispiel #3
0
        /// <summary>
        ///   Returns a byte hash from a string
        /// </summary>
        /// <param name = "s">string to hash</param>
        /// <returns>byte-array that contains the hash</returns>
        public byte[] GetByteHashFromString(string s)
        {
            byte[] b   = Encoding.UTF8.GetBytes(s);
            var    md4 = new MD4();

            md4.EngineUpdate(b, 0, b.Length);

            return(md4.EngineDigest());
        }
Beispiel #4
0
        /// <summary>
        ///   Returns a byte hash from the input byte
        /// </summary>
        /// <param name = "b">byte to hash</param>
        /// <returns>binary hash of the input byte</returns>
        public byte[] GetByteHashFromByte(byte b)
        {
            var md4 = new MD4();

            md4.EngineUpdate(b);

            return md4.EngineDigest();
        }
Beispiel #5
0
        /// <summary>
        ///   Returns a binary hash from an input byte array
        /// </summary>
        /// <param name = "b">byte-array to hash</param>
        /// <returns>binary hash of input</returns>
        public byte[] GetByteHashFromBytes(byte[] b)
        {
            var md4 = new MD4();

            md4.EngineUpdate(b, 0, b.Length);

            return md4.EngineDigest();
        }
Beispiel #6
0
        /// <summary>
        ///   Returns a byte hash from a string
        /// </summary>
        /// <param name = "s">string to hash</param>
        /// <returns>byte-array that contains the hash</returns>
        public byte[] GetByteHashFromString(string s)
        {
            byte[] b = Encoding.UTF8.GetBytes(s);
            var md4 = new MD4();

            md4.EngineUpdate(b, 0, b.Length);

            return md4.EngineDigest();
        }