public static HasherOptions CreateMergedInstance(HasherOptions options = null)
        {
            // Merge Options with Global Options
            HasherOptions globalOptions = GlobalCryptographyOptions.HasherOptions.MemberwiseClone() as HasherOptions;
            HasherOptions result        = options == null ? globalOptions : ObjectUtils.MergeObjects(options, globalOptions) as HasherOptions;

            return(result);
        }
Exemple #2
0
 /// <summary>
 /// Creates a Hasher with a specified algorithm and custom options
 /// </summary>
 /// <param name="algorithm"></param>
 /// <param name="options"></param>
 public Hasher(HashAlgorithm algorithm = null, HasherOptions options = null)
 {
     _algorithm = algorithm != null ? algorithm : SHA256.Create();
     Options    = HasherOptions.CreateMergedInstance(options);
 }
Exemple #3
0
 /// <summary>
 /// Creates a Hasher with custom options.
 /// </summary>
 /// <param name="options"></param>
 public Hasher(HasherOptions options) : this(null, options)
 {
 }