From e7078520db1622b4726a1b9e9c312002a48d474b Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 30 Apr 2009 19:57:07 +0000 Subject: * refactor: move iar name hashing into a method --- OpenSim/Framework/Communications/OspResolver.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/OspResolver.cs b/OpenSim/Framework/Communications/OspResolver.cs index 4627e30..924a4a9 100644 --- a/OpenSim/Framework/Communications/OspResolver.cs +++ b/OpenSim/Framework/Communications/OspResolver.cs @@ -105,6 +105,16 @@ namespace OpenSim.Framework.Communications } /// + /// Hash a profile name into a UUID + /// + /// + /// + public static UUID HashName(string name) + { + return new UUID(Utils.MD5(Encoding.Unicode.GetBytes(name)), 0); + } + + /// /// Resolve an OSPI name by querying existing persistent user profiles. If there is no persistent user profile /// then a temporary user profile is inserted in the cache. /// @@ -133,7 +143,7 @@ namespace OpenSim.Framework.Communications UserProfileData tempUserProfile = new UserProfileData(); tempUserProfile.FirstName = firstName; tempUserProfile.SurName = lastName; - tempUserProfile.ID = new UUID(Utils.MD5(Encoding.Unicode.GetBytes(tempUserProfile.Name)), 0); + tempUserProfile.ID = HashName(tempUserProfile.Name); m_log.DebugFormat( "[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID); -- cgit v1.1