コード例 #1
0
 def from_string(cls, hash):
     if not cls.identify(hash):
         raise uh.exc.InvalidHashError(cls)
     if isinstance(hash, bytes):
         hash = hash.decode("ascii")
     return cls(salt=hash[5:-40], checksum=hash[-40:])
コード例 #2
0
ファイル: test_utils_handlers.py プロジェクト: cutso/passlib
 def from_string(cls, hash):
     if not cls.identify(hash):
         raise uh.exc.InvalidHashError(cls)
     if isinstance(hash, bytes):
         hash = hash.decode("ascii")
     return cls(salt=hash[5:-40], checksum=hash[-40:])