diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index a54c379bc6..df875d5b73 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1337,17 +1337,32 @@ namespace OpenSim.Framework
///
///
///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static string SHA1Hash(byte[] data)
{
byte[] hash = ComputeSHA1Hash(data);
return bytesToHexString(hash, false);
}
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
private static byte[] ComputeSHA1Hash(byte[] src)
{
return SHA1.HashData(src);
}
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static string SHA256Hash(byte[] data)
+ {
+ return SHA256Hash(data.AsSpan());
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static string SHA256Hash(ReadOnlySpan data)
+ {
+ byte[] hash = SHA256.HashData(data);
+ return bytesToHexString(hash, false);
+ }
+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static UUID ComputeSHA1UUID(string src)
{
@@ -3520,7 +3535,7 @@ namespace OpenSim.Framework
catch (Exception)
{
Interlocked.Decrement(ref numQueuedThreadFuncs);
- activeThreads.TryRemove(threadFuncNum, out ThreadInfo dummy);
+ activeThreads.TryRemove(threadFuncNum, out _);
throw;
}
}