internal static int GetSetsCount(CharSetOptions sets) { var count = 0; if ((sets & CharSetOptions.Digits) != 0) { count++; } if ((sets & CharSetOptions.LowerCaseLetters) != 0) { count++; } if ((sets & CharSetOptions.UpperCaseLetters) != 0) { count++; } return(count); }
/// <summary> /// Builds a joined read-only list of char sets specified by options /// </summary> internal static ImmutableList <ImmutableArray <char> > BuildCharSets(CharSetOptions sets) { var charSets = new List <ImmutableArray <char> >(); if ((sets & CharSetOptions.Digits) != 0) { charSets.Add(Digits); } if ((sets & CharSetOptions.LowerCaseLetters) != 0) { charSets.Add(LowerLetters); } if ((sets & CharSetOptions.UpperCaseLetters) != 0) { charSets.Add(UpperLetters); } return(charSets.ToImmutableList()); }
public TokenOptions WithUpperLetters() { _charSets |= CharSetOptions.UpperCaseLetters; return(this); }
/// <summary> /// Includes digits as part of a token /// </summary> public TokenOptions WithDigits() { _charSets |= CharSetOptions.Digits; return(this); }