def valid_hash(value, hashed): return bcrypt.hashpw(value, hashed) == hashed
def hash(value): salt = bcrypt.gensalt() return bcrypt.hashpw(str(value), salt)