aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Util.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs3
2 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 7217ece..df7a552 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -334,6 +334,17 @@ namespace OpenSim.Framework
334 return sb.ToString(); 334 return sb.ToString();
335 } 335 }
336 336
337 /// <summary>
338 /// Return an SHA1 hash of the given string
339 /// </summary>
340 /// <param name="src"></param>
341 /// <returns></returns>
342 public static string SHA1Hash(string src)
343 {
344 SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider();
345 return BitConverter.ToString(SHA1.ComputeHash(Encoding.Default.GetBytes(src))).Replace("-", String.Empty);
346 }
347
337 public static int fast_distance2d(int x, int y) 348 public static int fast_distance2d(int x, int y)
338 { 349 {
339 x = Math.Abs(x); 350 x = Math.Abs(x);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 10a3133..36b524a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5890,8 +5890,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5890 public LSL_String llSHA1String(string src) 5890 public LSL_String llSHA1String(string src)
5891 { 5891 {
5892 m_host.AddScriptLPS(1); 5892 m_host.AddScriptLPS(1);
5893 return ""; //ckrinke 1/27 This needs to return a proper hash. 5893 return Util.SHA1Hash(src).ToLower();
5894 } 5894 }
5895
5895 private ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist) 5896 private ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist)
5896 { 5897 {
5897 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); 5898 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();