Web Tool/script that takes a list of IPs and finds the most efficient CIDR ranges?

We used to use some home-grown script for this back in the day when I worked at an Abuse desk, and we used it often to minimize the number of individual lines in our deny networks files.

I do not recollect what language it was in but I do recall that the script would be able to handle a list of individual IPs as well as smaller CIDR ranges and then suggest new CIDR for the entire sample of IPs.

I’ve poked around a bit but don’t seem to be searching for the right terms if such a tool or script is out there somewhere.

Thanks in advance!