aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-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 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);