diff options
author | UbitUmarov | 2018-10-19 18:35:31 +0100 |
---|---|---|
committer | UbitUmarov | 2018-10-19 18:35:31 +0100 |
commit | 2886408a76dfc9b980b04d476768d25229a4c0d5 (patch) | |
tree | 700e823bc5cc216a98cd6a99d5da15ce46117c29 /OpenSim/Framework/Util.cs | |
parent | cap LSLSyntax was enabled by mistake (diff) | |
download | opensim-SC-2886408a76dfc9b980b04d476768d25229a4c0d5.zip opensim-SC-2886408a76dfc9b980b04d476768d25229a4c0d5.tar.gz opensim-SC-2886408a76dfc9b980b04d476768d25229a4c0d5.tar.bz2 opensim-SC-2886408a76dfc9b980b04d476768d25229a4c0d5.tar.xz |
autogen LSLSyntax version uuid
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 17 |
1 files changed, 15 insertions, 2 deletions
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 | |||
864 | private static byte[] ComputeSHA1Hash(byte[] src) | 864 | private static byte[] ComputeSHA1Hash(byte[] src) |
865 | { | 865 | { |
866 | byte[] ret; | 866 | byte[] ret; |
867 | using(SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider()) | 867 | using (SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider()) |
868 | ret = SHA1.ComputeHash(src); | 868 | ret = SHA1.ComputeHash(src); |
869 | return ret; | 869 | return ret; |
870 | } | 870 | } |
871 | 871 | ||
872 | public static UUID ComputeSHA1UUID(string src) | ||
873 | { | ||
874 | return ComputeSHA1UUID(Encoding.Default.GetBytes(src)); | ||
875 | } | ||
876 | |||
877 | public static UUID ComputeSHA1UUID(byte[] src) | ||
878 | { | ||
879 | byte[] ret; | ||
880 | using (SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider()) | ||
881 | ret = SHA1.ComputeHash(src); | ||
882 | return new UUID(ret, 2); | ||
883 | } | ||
884 | |||
872 | public static int fast_distance2d(int x, int y) | 885 | public static int fast_distance2d(int x, int y) |
873 | { | 886 | { |
874 | x = Math.Abs(x); | 887 | x = Math.Abs(x); |