Esempio n. 1
0
        public void Clone_SeperateStateFromOriginal()
        {
            var digest = new SHA1Digest();
            var buffer = Encoding.UTF8.GetBytes("The quick brown fox jumps");

            digest.Update(buffer);

            var digest2 = digest.Clone();

            buffer = Encoding.UTF8.GetBytes(" over the lazy dog");
            digest2.Update(buffer);

            var result1 = digest.DigestBuffer();
            var result2 = digest2.DigestBuffer();

            AssertSHA1("743e27565bb39d4cf6cdf7b19450f94ef12b2206", result1);
            AssertSHA1("2fd4e1c67a2d28fced849ee1bb76e7391b93eb12", result2);
        }