aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Framework/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.Framework/Util.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim.Framework/Util.cs b/OpenSim.Framework/Util.cs
index 6f60925..400f415 100644
--- a/OpenSim.Framework/Util.cs
+++ b/OpenSim.Framework/Util.cs
@@ -1,4 +1,5 @@
1using System; 1using System;
2using System.Security.Cryptography;
2using System.Collections.Generic; 3using System.Collections.Generic;
3using System.Text; 4using System.Text;
4using libsecondlife; 5using libsecondlife;
@@ -43,6 +44,16 @@ namespace OpenSim.Framework.Utilities
43 return timestamp; 44 return timestamp;
44 } 45 }
45 46
47 public static string Md5Hash(string pass)
48 {
49 MD5 md5 = MD5CryptoServiceProvider.Create();
50 byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass));
51 StringBuilder sb = new StringBuilder();
52 for (int i = 0; i < dataMd5.Length; i++)
53 sb.AppendFormat("{0:x2}", dataMd5[i]);
54 return sb.ToString();
55 }
56
46 //public static int fast_distance2d(int x, int y) 57 //public static int fast_distance2d(int x, int y)
47 //{ 58 //{
48 // x = System.Math.Abs(x); 59 // x = System.Math.Abs(x);