def _convert_hashes(values):
    """Convert Pipfile.lock hash lines into InstallRequirement option format.

    The option format uses a str-list mapping. Keys are hash algorithms, and
    the list contains all values of that algorithm.
    """
    hashes = {}
    if not values:
        return hashes
    for value in values:
        try:
            name, value = value.split(':', 1)
        except ValueError:
            name = 'sha256'
        if name not in hashes:
            hashes[name] = []
        hashes[name].append(value)
    return hashes
