Exemple #1
0
 def from_string(cls, hash):
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, sep=u("."),
                                      handler=cls)
     salt = unhexlify(salt.encode("ascii"))
     if chk:
         chk = unhexlify(chk.encode("ascii"))
     return cls(rounds=rounds, salt=salt, checksum=chk)
Exemple #2
0
 def from_string(cls, hash):
     # NOTE: passlib deviation - forbidding zero-padded rounds
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, rounds_base=16, handler=cls)
     salt = b64decode(salt.encode("ascii"), CTA_ALTCHARS)
     if chk:
         chk = b64decode(chk.encode("ascii"), CTA_ALTCHARS)
     return cls(rounds=rounds, salt=salt, checksum=chk)
Exemple #3
0
 def from_string(cls, hash):
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, sep=u("."),
                                      handler=cls)
     salt = unhexlify(salt.encode("ascii"))
     if chk:
         chk = unhexlify(chk.encode("ascii"))
     return cls(rounds=rounds, salt=salt, checksum=chk)
Exemple #4
0
 def from_string(cls, hash):
     # NOTE: passlib deviation - forbidding zero-padded rounds
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, rounds_base=16, handler=cls)
     salt = b64decode(salt.encode("ascii"), CTA_ALTCHARS)
     if chk:
         chk = b64decode(chk.encode("ascii"), CTA_ALTCHARS)
     return cls(rounds=rounds, salt=salt, checksum=chk)
Exemple #5
0
 def from_string(cls, hash):
     rounds, salt, chk = uh.parse_mc3(hash,
                                      cls.ident,
                                      rounds_base=16,
                                      default_rounds=400,
                                      handler=cls)
     return cls(rounds=rounds, salt=salt, checksum=chk)
 def from_string(cls, hash):
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, handler=cls)
     return cls(rounds=rounds, salt=salt, checksum=chk)
Exemple #7
0
 def from_string(cls, hash):
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, handler=cls)
     salt = ab64_decode(salt.encode("ascii"))
     if chk:
         chk = ab64_decode(chk.encode("ascii"))
     return cls(rounds=rounds, salt=salt, checksum=chk)
Exemple #8
0
 def from_string(cls, hash):
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, rounds_base=16,
                                      default_rounds=400, handler=cls)
     return cls(rounds=rounds, salt=salt, checksum=chk)
Exemple #9
0
 def from_string(cls, hash):
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, handler=cls)
     salt = ab64_decode(salt.encode("ascii"))
     if chk:
         chk = ab64_decode(chk.encode("ascii"))
     return cls(rounds=rounds, salt=salt, checksum=chk)
Exemple #10
0
 def from_string(cls, hash):
     rounds, salt, chk = uh.parse_mc3(hash, cls.ident, handler=cls)
     return cls(rounds=rounds, salt=salt, checksum=chk)