cosmetics

This commit is contained in:
UbitUmarov
2022-10-22 22:51:55 +01:00
parent 5a7157efc8
commit d27516ac01
4 changed files with 68 additions and 31 deletions

View File

@@ -8231,12 +8231,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llSHA256String(LSL_String input)
{
byte[] bytes;
// Create a SHA256
using SHA256 sha256Hash = SHA256.Create();
// ComputeHash - returns byte array
Span<byte> bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input)).AsSpan();
return Util.bytesToHexString(bytes, true);
using (SHA256 sha256Hash = SHA256.Create())
{
// ComputeHash - returns byte array
bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input.m_string));
}
return Util.bytesToLowcaseHexString(bytes);
}
protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, byte profileshape, byte pathcurve)

View File

@@ -2619,13 +2619,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public string osSHA256(string input)
{
byte[] bytes;
// Create a SHA256
using (SHA256 sha256Hash = SHA256.Create())
{
using (SHA256 sha256Hash = SHA256.Create())
{
// ComputeHash - returns byte array
Span<byte> bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input)).AsSpan();
return Util.bytesToHexString(bytes, true);
bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
}
return Util.bytesToLowcaseHexString(bytes);
}
/// <summary>