示例#1
0
        public void Compute1024Bytes() {
            byte[] data = new byte[1024];

            using (SHA1Managed sha1 = new SHA1Managed())
            using (SHA1Reuse reuse = new SHA1Reuse()) {
                Assert.IsTrue(reuse.ComputeHash(data).SequenceEqual(sha1.ComputeHash(data)));
            }

            using (SHA1Managed sha1 = new SHA1Managed())
            using (SHA1Reuse reuse = new SHA1Reuse()) {
                Assert.IsTrue(reuse.ComputeHash(data).SequenceEqual(sha1.ComputeHash(data)));
            }
        }
示例#2
0
        public void ComputeArray([Values(0, 1, 2, 10, 1024, 325245)]long length) {
            byte[] data = new byte[length];

            using (SHA1Managed sha1 = new SHA1Managed())
            using (SHA1Reuse reuse = new SHA1Reuse()) {
                Assert.IsTrue(reuse.ComputeHash(data).SequenceEqual(sha1.ComputeHash(data)));
            }

            using (SHA1Managed sha1 = new SHA1Managed())
            using (SHA1Reuse reuse = new SHA1Reuse()) {
                Assert.IsTrue(reuse.ComputeHash(data).SequenceEqual(sha1.ComputeHash(data)));
            }
        }
示例#3
0
        public void Compute1024Bytes()
        {
            byte[] data = new byte[1024];

            using (SHA1Managed sha1 = new SHA1Managed())
                using (SHA1Reuse reuse = new SHA1Reuse()) {
                    Assert.IsTrue(reuse.ComputeHash(data).SequenceEqual(sha1.ComputeHash(data)));
                }

            using (SHA1Managed sha1 = new SHA1Managed())
                using (SHA1Reuse reuse = new SHA1Reuse()) {
                    Assert.IsTrue(reuse.ComputeHash(data).SequenceEqual(sha1.ComputeHash(data)));
                }
        }
示例#4
0
        public void ComputeArray([Values(0, 1, 2, 10, 1024, 325245)] long length)
        {
            byte[] data = new byte[length];

            using (SHA1Managed sha1 = new SHA1Managed())
                using (SHA1Reuse reuse = new SHA1Reuse()) {
                    Assert.IsTrue(reuse.ComputeHash(data).SequenceEqual(sha1.ComputeHash(data)));
                }

            using (SHA1Managed sha1 = new SHA1Managed())
                using (SHA1Reuse reuse = new SHA1Reuse()) {
                    Assert.IsTrue(reuse.ComputeHash(data).SequenceEqual(sha1.ComputeHash(data)));
                }
        }