Beispiel #1
0
            private static IOptions <PasswordHasherOptions> BuildOptions(PasswordHasherCompatibilityMode?compatMode, int?iterCount)
            {
                var options = new PasswordHasherOptionsAccessor();

                if (compatMode != null)
                {
                    options.Value.CompatibilityMode = (PasswordHasherCompatibilityMode)compatMode;
                }
                if (iterCount != null)
                {
                    options.Value.IterationCount = (int)iterCount;
                }
                return(options);
            }
            private static IOptions <PasswordHasherOptions> BuildOptions(PasswordHasherCompatibilityMode?compatMode, int?iterCount)
            {
                var options = new PasswordHasherOptionsAccessor();

                if (compatMode != null)
                {
                    options.Value.CompatibilityMode = (PasswordHasherCompatibilityMode)compatMode;
                }
                if (iterCount != null)
                {
                    options.Value.IterationCount = (int)iterCount;
                }
                Assert.NotNull(options.Value.Rng); // should have a default value
                options.Value.Rng = new SequentialRandomNumberGenerator();
                return(options);
            }
 public PasswordHasher(PasswordHasherCompatibilityMode?compatMode = null, int?iterCount = null)
     : base(BuildOptions(compatMode, iterCount))
 {
 }