/// <summary> /// Creates a new <see cref="IMurmurHash2"/> instance with the specified configuration. /// </summary> /// <param name="config">Configuration to use when constructing the instance.</param> /// <returns>A <see cref="IMurmurHash2"/> instance.</returns> public IMurmurHash2 Create(IMurmurHash2Config config) { if (config == null) { throw new ArgumentNullException(nameof(config)); } return(new MurmurHash2_Implementation(config)); }
public MurmurHash2_Implementation(IMurmurHash2Config config) { if (config == null) { throw new ArgumentNullException(nameof(config)); } _config = config.Clone(); if (!_validHashSizes.Contains(_config.HashSizeInBits)) { throw new ArgumentOutOfRangeException($"{nameof(config)}.{nameof(config.HashSizeInBits)}", _config.HashSizeInBits, $"{nameof(config)}.{nameof(config.HashSizeInBits)} must be contained within MurmurHash2.ValidHashSizes."); } }