|
@@ -47,6 +47,7 @@ using System.Runtime.Remoting.Lifetime;
|
|
|
using System.Text;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Threading;
|
|
|
+using System.Security.Cryptography;
|
|
|
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
|
|
using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
|
|
|
using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
|
|
@@ -2606,6 +2607,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|
|
return retval;
|
|
|
}
|
|
|
|
|
|
+ public string osSHA256(string input)
|
|
|
+ {
|
|
|
+ // Create a SHA256
|
|
|
+ using (SHA256 sha256Hash = SHA256.Create())
|
|
|
+ {
|
|
|
+ // 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Get the nickname of this grid, as set in the [GridInfo] config section.
|
|
|
/// </summary>
|
|
@@ -5999,4 +6020,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|
|
return 1;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|