add another form of bytesToHexString(byte[] bytes, bool lowercase)

This commit is contained in:
UbitUmarov
2020-12-29 14:41:41 +00:00
parent 0e8ea0486d
commit 71065f19ad
2 changed files with 59 additions and 10 deletions

View File

@@ -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);
}
}