diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs
index 5c92be9e4e..0b69ca4f17 100644
--- a/OpenSim/Data/MySQL/MySQLXAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs
@@ -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(
diff --git a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
index 1798d20508..e1195b15d4 100644
--- a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Data.PGSQL
///
/// We can reuse this for all hashing since all methods are single-threaded through m_dbBLock
///
- private HashAlgorithm hasher = new SHA256CryptoServiceProvider();
+ private HashAlgorithm hasher = SHA256.Create();
#region IPlugin Members
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index ae500e934e..4dc456a18d 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -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();
return metadata;
}
diff --git a/OpenSim/Services/FSAssetService/FSAssetService.cs b/OpenSim/Services/FSAssetService/FSAssetService.cs
index 7754a81e3b..3e92227cac 100644
--- a/OpenSim/Services/FSAssetService/FSAssetService.cs
+++ b/OpenSim/Services/FSAssetService/FSAssetService.cs
@@ -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);
}