import hashlib


def calcule_hash_pass(login_info, password):
    """calcule_hash_pass(login_info, password) -> str
    Hash the password

    Params:
        login_info: array
        password: password from input_password()

    Return:
        The hashed password

    Example:
        calcule_hash_pass(login_info, 'aaaa') => {
            a557fff85d90f09c97c1db3c330ddd9ffa1d90e1f28743ad463c5a39e728553e;
            57e4684499603e19b2b6df03fec70f10622191d1fc9d913ef301512d15a9e5ab;
            41602b57e4934f52ccbb736301bcd25a;
            9ad21beadc9697d470d314f2a5349ccb
        }
    """
    sha256sum = hashlib.sha256
    md5sum = hashlib.md5
    alea_actuel = bytes(login_info['alea_actuel'] + password, 'utf-8')
    alea_futur = bytes(login_info['alea_futur'] + password, 'utf-8')

    res = '{%s;%s;%s;%s}' % (
        sha256sum(alea_actuel).hexdigest(),
        sha256sum(alea_futur).hexdigest(),
        md5sum(alea_actuel).hexdigest(),
        md5sum(alea_futur).hexdigest()
    )

    return res