Mass rename project for rebranding

This commit is contained in:
TheXamlGuy
2024-06-09 14:00:36 +01:00
parent 1f777e19cd
commit 45712d0a70
241 changed files with 310 additions and 366 deletions
+29
View File
@@ -0,0 +1,29 @@
using System.Text.RegularExpressions;
namespace Wallet;
public partial class DiversityBonusRule :
IPasswordRule
{
public int CalculateScore(string password)
{
bool hasUppercase = UppercaseRegex().IsMatch(password);
bool hasLowercase = LowercaseRegex().IsMatch(password);
bool hasDigit = DigitRegex().IsMatch(password);
bool hasSpecialChar = SpecialCharRegex().IsMatch(password);
return (hasUppercase && hasLowercase && hasDigit && hasSpecialChar) ? 2 : 0;
}
[GeneratedRegex(@"[A-Z]")]
private static partial Regex UppercaseRegex();
[GeneratedRegex(@"[a-z]")]
private static partial Regex LowercaseRegex();
[GeneratedRegex(@"\d")]
private static partial Regex DigitRegex();
[GeneratedRegex(@"[^a-zA-Z0-9]")]
private static partial Regex SpecialCharRegex();
}