pysasl.hashing
Package¶
Provides an abstraction and several implementations for the ability to hash and verify secrets.
- class pysasl.hashing.HashT¶
Type variable for a
HashInterface
.alias of TypeVar(‘HashT’, bound=
HashInterface
)
- class pysasl.hashing.HashInterface(*args, **kwargs)[source]¶
Defines a basic interface for hash implementations. This is specifically designed to be compatible with
passlib
hashes.- abstract copy(**kwargs)[source]¶
Return a copy of the hash implementation. The kwargs may be used by some hashes to modify settings on the hash.
- class pysasl.hashing.BuiltinHash(*, hash_name='sha256', salt_len=16, rounds=500000)[source]¶
Implements
HashInterface
using thehashlib.pbkdf2_hmac()
function and random salt.The constructor arguments are the values used when encoding. When decoding, these values are read from the digest format.
- Parameters:
See also
- copy(*, hash_name=None, salt_len=None, rounds=None, **kwargs)[source]¶
Return a copy of the hash implementation, possibly with updated parameters.
- Parameters:
- Return type:
- class pysasl.hashing.Cleartext(*args, **kwargs)[source]¶
Implements
HashInterface
with no hashing performed.- copy(**kwargs)[source]¶
Return a copy of the hash implementation. The kwargs may be used by some hashes to modify settings on the hash.