Make llSHA1Hash SL compatible when using characters like the euro symbol (€)

avinationmerge
Tom 2011-01-26 12:40:33 -08:00
parent 3c075aaf46
commit 4d3696d658
1 changed files with 3 additions and 1 deletions

View File

@ -32,6 +32,7 @@ using System.Diagnostics; //for [DebuggerNonUserCode]
using System.Runtime.Remoting.Lifetime; using System.Runtime.Remoting.Lifetime;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Security.Cryptography;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Nini.Config; using Nini.Config;
using log4net; using log4net;
@ -6944,7 +6945,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llSHA1String(string src) public LSL_String llSHA1String(string src)
{ {
m_host.AddScriptLPS(1); 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) protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist)