feat: Adds .NET 10 / C# 14 support. (#2258)
### Summary * Adds .NET 10 support * Bumps to C# 14
This commit is contained in:
parent
fbf8497c59
commit
3a3f5ee518
16 changed files with 124 additions and 154 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright 2019-2023 - ModernUO Development Team *
|
||||
* Copyright 2019-2025 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: Argon2PasswordProtection.cs *
|
||||
* *
|
||||
|
|
@ -15,18 +15,17 @@
|
|||
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Server.Accounting.Security
|
||||
namespace Server.Accounting.Security;
|
||||
|
||||
public class Argon2PasswordProtection : IPasswordProtection
|
||||
{
|
||||
public class Argon2PasswordProtection : IPasswordProtection
|
||||
{
|
||||
public static IPasswordProtection Instance = new Argon2PasswordProtection();
|
||||
public static IPasswordProtection Instance = new Argon2PasswordProtection();
|
||||
|
||||
private readonly Argon2PasswordHasher m_PasswordHasher = new(rng: BuiltInSecureRng.Generator);
|
||||
private readonly Argon2PasswordHasher m_PasswordHasher = new(rng: RandomNumberGenerator.Create());
|
||||
|
||||
public string EncryptPassword(string plainPassword) =>
|
||||
m_PasswordHasher.Hash(plainPassword);
|
||||
public string EncryptPassword(string plainPassword) =>
|
||||
m_PasswordHasher.Hash(plainPassword);
|
||||
|
||||
public bool ValidatePassword(string encryptedPassword, string plainPassword) =>
|
||||
m_PasswordHasher.Verify(encryptedPassword, plainPassword);
|
||||
}
|
||||
public bool ValidatePassword(string encryptedPassword, string plainPassword) =>
|
||||
m_PasswordHasher.Verify(encryptedPassword, plainPassword);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue