mirror of
https://github.com/opensim/opensim.git
synced 2026-07-05 11:23:29 +08:00
add another form of bytesToHexString(byte[] bytes, bool lowercase)
This commit is contained in:
@@ -2612,16 +2612,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// Create a SHA256
|
||||
using (SHA256 sha256Hash = SHA256.Create())
|
||||
{
|
||||
// ComputeHash - returns byte array
|
||||
// ComputeHash - returns byte array
|
||||
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
|
||||
|
||||
// Convert byte array to a string
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < bytes.Length; i++)
|
||||
{
|
||||
builder.Append(bytes[i].ToString("x2"));
|
||||
}
|
||||
return builder.ToString();
|
||||
return Util.bytesToHexString(bytes, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user