Code cleanup/optimization in VirtualMailManager's __getSalt().
authorPascal Volk <neverseen@users.sourceforge.net>
Thu, 03 Sep 2009 05:33:52 +0000
changeset 140 ffac064bd728
parent 139 7f6911bd11cd
child 141 ecd6a379e523
Code cleanup/optimization in VirtualMailManager's __getSalt().
VirtualMailManager/VirtualMailManager.py
--- a/VirtualMailManager/VirtualMailManager.py	Wed Sep 02 20:30:16 2009 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Thu Sep 03 05:33:52 2009 +0000
@@ -370,10 +370,7 @@
         if self.__scheme == 'CRYPT':
             salt = '%s%s' % (choice(SALTCHARS), choice(SALTCHARS))
         elif self.__scheme in ['MD5', 'MD5-CRYPT']:
-            salt = '$1$'
-            for i in range(8):
-                salt += choice(SALTCHARS)
-            salt += '$'
+            salt = '$1$%s$' % ''.join([choice(SALTCHARS) for x in xrange(8)])
         return salt
 
     def __pwCrypt(self, password):