Alternative to System.Web.Security.Membership.GeneratePassword in aspnetcore (netcoreapp1.0)
Here’s a class/method, based on the source of Membership.GeneratePassword of that works on .NET Core: public static class Password { private static readonly char[] Punctuations = “!@#$%^&*()_-+=[{]};:>|./?”.ToCharArray(); public static string Generate(int length, int numberOfNonAlphanumericCharacters) { if (length < 1 || length > 128) { throw new ArgumentException(nameof(length)); } if (numberOfNonAlphanumericCharacters > length || numberOfNonAlphanumericCharacters < … Read more