Format ./web/backend/Infrastructure/Infrastructure.PasswordHashing

This commit is contained in:
Aaron Po
2026-06-20 15:13:02 -04:00
parent 1272a7ff40
commit e5d08c9ec8
3 changed files with 6 additions and 12 deletions

View File

@@ -32,7 +32,7 @@ public class Argon2Infrastructure : IPasswordInfrastructure
Salt = salt, Salt = salt,
DegreeOfParallelism = Math.Max(Environment.ProcessorCount, 1), DegreeOfParallelism = Math.Max(Environment.ProcessorCount, 1),
MemorySize = ArgonMemoryKb, MemorySize = ArgonMemoryKb,
Iterations = ArgonIterations Iterations = ArgonIterations,
}; };
byte[] hash = argon2.GetBytes(HashSize); byte[] hash = argon2.GetBytes(HashSize);
@@ -57,10 +57,7 @@ public class Argon2Infrastructure : IPasswordInfrastructure
{ {
try try
{ {
string[] parts = stored.Split( string[] parts = stored.Split(':', StringSplitOptions.RemoveEmptyEntries);
':',
StringSplitOptions.RemoveEmptyEntries
);
if (parts.Length != 2) if (parts.Length != 2)
return false; return false;
@@ -72,7 +69,7 @@ public class Argon2Infrastructure : IPasswordInfrastructure
Salt = salt, Salt = salt,
DegreeOfParallelism = Math.Max(Environment.ProcessorCount, 1), DegreeOfParallelism = Math.Max(Environment.ProcessorCount, 1),
MemorySize = ArgonMemoryKb, MemorySize = ArgonMemoryKb,
Iterations = ArgonIterations Iterations = ArgonIterations,
}; };
byte[] actual = argon2.GetBytes(expected.Length); byte[] actual = argon2.GetBytes(expected.Length);

View File

@@ -7,9 +7,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference <PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.1" />
Include="Konscious.Security.Cryptography.Argon2"
Version="1.3.1"
/>
</ItemGroup> </ItemGroup>
</Project> </Project>