Ejemplo n.º 1
0
        public static byte[] GetMd5Bytes(byte[] data)
        {
            var digest = new Md5Digest();

            digest.BlockUpdate(data, 0, data.Length);
            var hash = new byte[16];

            digest.DoFinal(hash, 0);

            return(hash);
        }
Ejemplo n.º 2
0
        /**
         * Copy constructor. This will copy the state of the provided
         * message digest.
         */

        public Md5Digest(Md5Digest t)
            : base(t)
        {
            _h1 = t._h1;
            _h2 = t._h2;
            _h3 = t._h3;
            _h4 = t._h4;

            Array.Copy(t._x, 0, _x, 0, t._x.Length);
            _xOff = t._xOff;
        }