replace obsolete code

This commit is contained in:
UbitUmarov
2022-09-20 21:40:56 +01:00
parent 31fa8b45df
commit 58f20c6d6e
4 changed files with 5 additions and 5 deletions

View File

@@ -246,7 +246,7 @@ namespace OpenSim.Data.MySQL
}
byte[] hash;
using (HashAlgorithm hasher = new SHA256CryptoServiceProvider())
using (HashAlgorithm hasher = SHA256.Create())
hash = hasher.ComputeHash(asset.Data);
// m_log.DebugFormat(

View File

@@ -63,7 +63,7 @@ namespace OpenSim.Data.PGSQL
/// <summary>
/// We can reuse this for all hashing since all methods are single-threaded through m_dbBLock
/// </summary>
private HashAlgorithm hasher = new SHA256CryptoServiceProvider();
private HashAlgorithm hasher = SHA256.Create();
#region IPlugin Members

View File

@@ -289,7 +289,7 @@ namespace OpenSim.Data.SQLite
metadata.CreatorID = row["CreatorID"].ToString();
// Current SHA1s are not stored/computed.
metadata.SHA1 = new byte[] {};
metadata.SHA1 = Array.Empty<byte>();
return metadata;
}

View File

@@ -364,8 +364,8 @@ namespace OpenSim.Services.FSAssetService
string GetSHA256Hash(byte[] data)
{
byte[] hash;
using (SHA256CryptoServiceProvider SHA256 = new SHA256CryptoServiceProvider())
hash = SHA256.ComputeHash(data);
using (SHA256 sha = SHA256.Create())
hash = sha.ComputeHash(data);
return BitConverter.ToString(hash).Replace("-", String.Empty);
}