def pad_b64(encoded):
    """Append = or == to the b64 string."""
    if len(encoded) % 4 == 0:
        pass
    elif len(encoded) % 4 == 3:
        encoded += "="
    elif len(encoded) % 4 == 2:
        encoded += "=="

    return encoded