import math


def get_length_from_entropy(entropy, list_length):
    """Calculate the number of words in a passphrase.

    The length returned is rounded up so that we always have at least
    ``entropy`` bits in a passphrase.

    Arguments:
    entropy -- desired minimum entropy of a passphrase in bits (shannons)
    list_length -- number of words in the word list
    """
    return math.ceil(entropy/math.log(list_length, 2))