Пример #1
0
 /// <param name="length"></param>
 /// <param name="requiredSets">The sets characters that the password must contain</param>
 /// <param name="predicate">An arbitrary function that the password must match</param>
 public static string GenerateComplex(int length, IReadOnlyCollection <HashSet <char> > requiredSets, Func <string, bool> predicate)
 {
     using (var random = new CryptoServiceRandom())
     {
         return(GenerateComplex(length, requiredSets, predicate, random));
     }
 }
Пример #2
0
 public static string Generate(int length, IReadOnlyCollection <ISet <char> > requiredSets, Func <string, bool> predicate)
 {
     using (var random = new CryptoServiceRandom())
     {
         return(Generate(length, requiredSets, predicate, random, EmbeddedTrigramStatistics.Instance));
     }
 }
Пример #3
0
 /// <param name="length"></param>
 /// <param name="allowed">The set of characters the password will be randomly made of</param>
 public static string Generate(int length, HashSet <char> allowed)
 {
     using (var random = new CryptoServiceRandom())
     {
         return(Generate(length, allowed, random));
     }
 }