import math


def __calc_entropy_password(password, pool_size):
    """
    Calculates the entropy of a random password
    :param password: The password
    :param pool_size: The size of the character pool used to generate password
    :return: Entropy
    """
    if not password or not pool_size:
        return 0

    # entropy = log_2(P^L) { R: Total number of possible choices, L: Length of the password }
    inner = math.pow(pool_size, len(password))
    return math.log(inner, 2)