Exemplo n.º 1
0
 def crypt_supports_variant(self, hash):
     """check if OS crypt is expected to support given ident"""
     from passlib.handlers.bcrypt import bcrypt, IDENT_2X, IDENT_2Y
     from passlib.utils import safe_crypt
     ident = bcrypt.from_string(hash)
     return (safe_crypt("test", ident + "04$5BJqKfqMQvV7nS.yUguNcu")
             or "").startswith(ident)
Exemplo n.º 2
0
 def crypt_supports_variant(self, hash):
     """check if OS crypt is expected to support given ident"""
     from passlib.handlers.bcrypt import bcrypt, IDENT_2X, IDENT_2Y
     from passlib.utils import safe_crypt
     ident = bcrypt.from_string(hash)
     return (safe_crypt("test", ident + "04$5BJqKfqMQvV7nS.yUguNcu") or "").startswith(ident)