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); }
/// <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); }
/// <summary> /// Creates a Hasher with custom options. /// </summary> /// <param name="options"></param> public Hasher(HasherOptions options) : this(null, options) { }