diff options
author | idb | 2009-01-29 19:47:55 +0000 |
---|---|---|
committer | idb | 2009-01-29 19:47:55 +0000 |
commit | ea6e4a95ce5e0fc8c5e3d049b43b9cc0ada65491 (patch) | |
tree | 12ac0afdb13186306d0c3389c0fb04adcadc4bd0 /OpenSim/Framework | |
parent | * minor: just a few formatting changes and log quietening (diff) | |
download | opensim-SC_OLD-ea6e4a95ce5e0fc8c5e3d049b43b9cc0ada65491.zip opensim-SC_OLD-ea6e4a95ce5e0fc8c5e3d049b43b9cc0ada65491.tar.gz opensim-SC_OLD-ea6e4a95ce5e0fc8c5e3d049b43b9cc0ada65491.tar.bz2 opensim-SC_OLD-ea6e4a95ce5e0fc8c5e3d049b43b9cc0ada65491.tar.xz |
Complete the implementation of llSHA1String.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Util.cs | 11 |
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); |