Added a password rule engine

This commit is contained in:
TheXamlGuy
2024-06-09 13:10:57 +01:00
parent e8372f875f
commit 84e89e1c47
12 changed files with 199 additions and 4 deletions
+13
View File
@@ -0,0 +1,13 @@
using System.Text.RegularExpressions;
namespace Bitvault;
public partial class DigitRule :
IPasswordRule
{
public int CalculateScore(string password) =>
Regex().IsMatch(password) ? 2 : 0;
[GeneratedRegex(@"\d")]
private static partial Regex Regex();
}