search and ai stabilization work, localization stablized.

This commit is contained in:
master
2026-02-24 23:29:36 +02:00
parent 4f947a8b61
commit b07d27772e
766 changed files with 55299 additions and 3221 deletions

View File

@@ -11,6 +11,7 @@ using System.IO;
using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks;
using static StellaOps.Localization.T;
namespace StellaOps.Cryptography;
@@ -63,7 +64,7 @@ public sealed class DefaultCryptoHash : ICryptoHash
"GOST3411-2012-512" => GostDigestUtilities.ComputeDigest(data, use256: false),
"BLAKE3-256" => ComputeBlake3(data),
"SM3" => ComputeSm3(data),
_ => throw new InvalidOperationException($"Unsupported hash algorithm '{algorithm}'.")
_ => throw new InvalidOperationException(_t("crypto.hash.algorithm_unsupported", algorithm))
};
}
@@ -93,7 +94,7 @@ public sealed class DefaultCryptoHash : ICryptoHash
"GOST3411-2012-512" => await ComputeGostStreamAsync(use256: false, stream, cancellationToken).ConfigureAwait(false),
"BLAKE3-256" => await ComputeBlake3StreamAsync(stream, cancellationToken).ConfigureAwait(false),
"SM3" => await ComputeSm3StreamAsync(stream, cancellationToken).ConfigureAwait(false),
_ => throw new InvalidOperationException($"Unsupported hash algorithm '{algorithm}'.")
_ => throw new InvalidOperationException(_t("crypto.hash.algorithm_unsupported", algorithm))
};
}
@@ -215,7 +216,7 @@ public sealed class DefaultCryptoHash : ICryptoHash
{
if (string.IsNullOrWhiteSpace(purpose))
{
throw new ArgumentException("Purpose cannot be null or empty.", nameof(purpose));
throw new ArgumentException(_t("crypto.hash.purpose_required"), nameof(purpose));
}
var opts = _complianceOptions.CurrentValue;
@@ -237,7 +238,7 @@ public sealed class DefaultCryptoHash : ICryptoHash
{
if (string.IsNullOrWhiteSpace(purpose))
{
throw new ArgumentException("Purpose cannot be null or empty.", nameof(purpose));
throw new ArgumentException(_t("crypto.hash.purpose_required"), nameof(purpose));
}
var profile = GetActiveProfile();