Exemplo n.º 1
0
 /// <summary>Initializes an instance of MultiHash.</summary>
 /// <param name="hashAlgorithms">The list of HashAlgorithms to use in the calculations.</param>
 /// <exception cref="ArgumentNullException">When the specified collection is null.</exception>
 public MultiHash(HashAlgorithmCollection hashAlgorithms) : base()
 {
     if (hashAlgorithms == null)
     {
         throw new ArgumentNullException("hashAlgorithms", Properties.Resources.hashListCantBeNull);
     }
     this.hashAlgorithms          = hashAlgorithms;
     this.hashAlgorithms.Changed += new EventHandler <ChangedEventArgs>(HashAlgorithmsChanged);
 }
        public void ConstructorCollectionTest()
        {
            HashAlgorithmCollection hashCollection = new HashAlgorithmCollection();
            MD5 md5 = new MD5();

            hashCollection.Add(md5);
            Sha1 sha1 = new Sha1();

            hashCollection.Add(sha1);
            Xor8 xor8 = new Xor8();

            hashCollection.Add(xor8);
            MultiHash hasher = new MultiHash(hashCollection);

            Assert.Contains(md5, hasher.HashAlgorithms);
            Assert.Contains(sha1, hasher.HashAlgorithms);
            Assert.Contains(xor8, hasher.HashAlgorithms);
        }
Exemplo n.º 3
0
 /// <summary>Initializes an instance of ParallelHash.</summary>
 /// <param name="hashAlgorithms">The list of HashAlgorithms to use in the calculations.</param>
 public ParallelHash(HashAlgorithmCollection hashAlgorithms) : base(hashAlgorithms)
 {
 }
 public void ConstructorNullTest()
 {
     HashAlgorithmCollection hashCollection = null;
     MultiHash hasher = new MultiHash(hashCollection);
 }
Exemplo n.º 5
0
 public void ConstructorNullTest()
 {
     HashAlgorithmCollection hashCollection = null;
     ParallelHash            hasher         = new ParallelHash(hashCollection);
 }