passlib.hash - Helper Functions

A couple of utility functions are available, mainly useful when writing custom password hash algorithms. The h64_* series of functions all provide utilities for encoding & decoding strings under the modified base64 system used by most of the standard unix hash algorithms.

passlib.hash.h64_encode(value, pad=False, num=False)

encode string of bytes into hash64 format

passlib.hash.h64_decode(value, pad=False, num=False)

decode string of bytes from hash64 format

passlib.hash.h64_gen_salt(size, pad=False)

generate hash64 salt of arbitrary length

passlib.hash.is_crypt_context(obj)

check if obj following CryptContext protocol

passlib.hash.is_crypt_alg(obj)

check if obj following CryptAlgorithm protocol

Previous topic

passlib.hash - Implementing a Custom Crypt Algorithm

Next topic

passlib.gen – Password Generation

This Page