Пример #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);
            }
Пример #2
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;
            }
            Assert.NotNull(options.Value.Rng); // should have a default value
            options.Value.Rng = new SequentialRandomNumberGenerator();
            return(options);
        }