@@ -81,10 +81,7 @@ def make_password(password, salt=None, hasher="default"):
8181
8282@functools .lru_cache (maxsize = None )
8383def get_hashers ():
84- hashers = []
85- hashers .append (PBKDF2PasswordHasher ())
86- hashers .append (PBKDF2SHA1PasswordHasher )
87- hashers .append (MD5PasswordHasher )
84+ hashers = [PBKDF2PasswordHasher (), PBKDF2SHA1PasswordHasher , MD5PasswordHasher ]
8885 return hashers
8986
9087
@@ -476,10 +473,10 @@ def verify(self, password, encoded):
476473 def safe_summary (self , encoded ):
477474 decoded = self .decode (encoded )
478475 return {
479- ( "algorithm" ) : decoded ["algorithm" ],
480- ( "work factor" ) : decoded ["work_factor" ],
481- ( "salt" ) : mask_hash (decoded ["salt" ]),
482- ( "checksum" ) : mask_hash (decoded ["checksum" ]),
476+ "algorithm" : decoded ["algorithm" ],
477+ "work factor" : decoded ["work_factor" ],
478+ "salt" : mask_hash (decoded ["salt" ]),
479+ "checksum" : mask_hash (decoded ["checksum" ]),
483480 }
484481
485482 def must_update (self , encoded ):
@@ -569,12 +566,12 @@ def verify(self, password, encoded):
569566 def safe_summary (self , encoded ):
570567 decoded = self .decode (encoded )
571568 return {
572- ( "algorithm" ) : decoded ["algorithm" ],
573- ( "work factor" ) : decoded ["work_factor" ],
574- ( "block size" ) : decoded ["block_size" ],
575- ( "parallelism" ) : decoded ["parallelism" ],
576- ( "salt" ) : mask_hash (decoded ["salt" ]),
577- ( "hash" ) : mask_hash (decoded ["hash" ]),
569+ "algorithm" : decoded ["algorithm" ],
570+ "work factor" : decoded ["work_factor" ],
571+ "block size" : decoded ["block_size" ],
572+ "parallelism" : decoded ["parallelism" ],
573+ "salt" : mask_hash (decoded ["salt" ]),
574+ "hash" : mask_hash (decoded ["hash" ]),
578575 }
579576
580577 def must_update (self , encoded ):
@@ -620,9 +617,9 @@ def verify(self, password, encoded):
620617 def safe_summary (self , encoded ):
621618 decoded = self .decode (encoded )
622619 return {
623- ( "algorithm" ) : decoded ["algorithm" ],
624- ( "salt" ) : mask_hash (decoded ["salt" ], show = 2 ),
625- ( "hash" ) : mask_hash (decoded ["hash" ]),
620+ "algorithm" : decoded ["algorithm" ],
621+ "salt" : mask_hash (decoded ["salt" ], show = 2 ),
622+ "hash" : mask_hash (decoded ["hash" ]),
626623 }
627624
628625 def must_update (self , encoded ):
0 commit comments