Encode a Password
    :param password: Password
    :param algorithm
    :param salt: Salt
    :param iterations: iterations
    :return: PBKDF2 hashed Password

def encode(password, algorithm, salt, iterations):
    """
    Encode a Password
    :param password: Password
    :param algorithm
    :param salt: Salt
    :param iterations: iterations
    :return: PBKDF2 hashed Password
    """
    hash = hashlib.pbkdf2_hmac(digest().name, password.encode(), salt.encode(), iterations)
    encoded = base64.b64encode(hash).decode('ascii').strip()
    return "%s$%d$%s$%s" % (algorithm, iterations, salt, encoded)