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
+12
View File
@@ -0,0 +1,12 @@
using System.Text.RegularExpressions;
namespace Bitvault;
public partial class SpecialCharRule : IPasswordRule
{
public int CalculateScore(string password) =>
Regex().IsMatch(password) ? 2 : 0;
[GeneratedRegex(@"[^a-zA-Z0-9]")]
private static partial Regex Regex();
}