示例#1
0
 /// <summary>
 /// This constructor is here to implement the clonability of this class
 /// </summary>
 /// <param name="md"> </param>
 private MD4_Old(MD4_Old md)
     : this()
 {
     //this();
     context = (uint[])md.context.Clone();
     buffer  = (byte[])md.buffer.Clone();
     count   = md.count;
 }
示例#2
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 static byte[] GetByteHashFromByte(byte b)
        {
            MD4_Old md4 = new MD4_Old();

            md4.engineUpdate(b);

            return(md4.engineDigest());
        }
示例#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 static byte[] GetByteHashFromString(string s)
        {
            byte[]  b   = Encoding.UTF8.GetBytes(s);
            MD4_Old md4 = new MD4_Old();

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

            return(md4.engineDigest());
        }
示例#4
0
文件: MD4.cs 项目: dizzydezz/jmm
 /// <summary>
 /// This constructor is here to implement the clonability of this class
 /// </summary>
 /// <param name="md"> </param>
 private MD4_Old(MD4_Old md)
     : this()
 {
     //this();
     context = (uint[])md.context.Clone();
     buffer = (byte[])md.buffer.Clone();
     count = md.count;
 }
示例#5
0
文件: MD4.cs 项目: dizzydezz/jmm
        /// <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 static byte[] GetByteHashFromString(string s)
        {
            byte[] b = Encoding.UTF8.GetBytes(s);
            MD4_Old md4 = new MD4_Old();

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

            return md4.engineDigest();
        }
示例#6
0
文件: MD4.cs 项目: dizzydezz/jmm
        /// <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 static byte[] GetByteHashFromBytes(byte[] b)
        {
            MD4_Old md4 = new MD4_Old();

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

            return md4.engineDigest();
        }