mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
replace obsolete code
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user