/// <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); }
/// <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); }
public void ConstructorNullTest() { HashAlgorithmCollection hashCollection = null; ParallelHash hasher = new ParallelHash(hashCollection); }