mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
* Minor tweaks with new userserver
* Fixed password encoding to match MD5 standard properly. * Fixed exception caused on user first login (minor) * Fixed exception caused by incorrect username (minor) * Returns login error rather than grid error if username is incorrect
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
@@ -43,6 +44,16 @@ namespace OpenSim.Framework.Utilities
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public static string Md5Hash(string pass)
|
||||
{
|
||||
MD5 md5 = MD5CryptoServiceProvider.Create();
|
||||
byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < dataMd5.Length; i++)
|
||||
sb.AppendFormat("{0:x2}", dataMd5[i]);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
//public static int fast_distance2d(int x, int y)
|
||||
//{
|
||||
// x = System.Math.Abs(x);
|
||||
|
||||
Reference in New Issue
Block a user