mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
actually write a hex string in caps
This commit is contained in:
@@ -1337,17 +1337,32 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[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<byte> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user