From 2886408a76dfc9b980b04d476768d25229a4c0d5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 19 Oct 2018 18:35:31 +0100 Subject: autogen LSLSyntax version uuid --- OpenSim/Framework/Util.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Util.cs') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index c5c4ab3..e12d37a 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -864,11 +864,24 @@ namespace OpenSim.Framework private static byte[] ComputeSHA1Hash(byte[] src) { byte[] ret; - using(SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider()) - ret = SHA1.ComputeHash(src); + using (SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider()) + ret = SHA1.ComputeHash(src); return ret; } + public static UUID ComputeSHA1UUID(string src) + { + return ComputeSHA1UUID(Encoding.Default.GetBytes(src)); + } + + public static UUID ComputeSHA1UUID(byte[] src) + { + byte[] ret; + using (SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider()) + ret = SHA1.ComputeHash(src); + return new UUID(ret, 2); + } + public static int fast_distance2d(int x, int y) { x = Math.Abs(x); -- cgit v1.1