From 4d3696d6581e61581915614b150909ff797a4956 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 26 Jan 2011 12:40:33 -0800 Subject: [PATCH] =?UTF-8?q?Make=20llSHA1Hash=20SL=20compatible=20when=20us?= =?UTF-8?q?ing=20characters=20like=20the=20euro=20symbol=20(=E2=82=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index dffc0bdb51..1ccf76e240 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -32,6 +32,7 @@ using System.Diagnostics; //for [DebuggerNonUserCode] using System.Runtime.Remoting.Lifetime; using System.Text; using System.Threading; +using System.Security.Cryptography; using System.Text.RegularExpressions; using Nini.Config; using log4net; @@ -6944,7 +6945,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llSHA1String(string src) { m_host.AddScriptLPS(1); - return Util.SHA1Hash(src).ToLower(); + SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider(); + return BitConverter.ToString(SHA1.ComputeHash(Encoding.UTF8.GetBytes(src))).Replace("-", String.Empty).ToLower(); } protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist)