Skip to content

Dan-Duran/ip-calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

IP Conversion Tool

IP Calculator for IP RANGE, HEX, BINARY, CIDR

This quick Python script provides a command-line interface for converting IP addresses and ranges between different formats. It supports converting between decimal, hexadecimal, binary, and CIDR notation. The tool also allows for converting CIDR notation to IP ranges and finding the smallest CIDR block that encompasses a given IP range.

Features

  • Convert IP addresses to hexadecimal format.
  • Convert IP addresses to binary format.
  • Convert binary IP addresses back to decimal format.
  • Convert hexadecimal IP addresses back to decimal format.
  • Convert CIDR notation to IP range.
  • Convert an IP range to the smallest possible CIDR block that covers the entire range.

Usage

Run the script in your terminal, and you will be presented with a menu of options:

Menu:

  1. Convert IP to HEX
  2. Convert IP to Binary
  3. Convert Binary to IP
  4. Convert HEX to IP
  5. Convert CIDR to IP Range
  6. Convert IP Range to the smallest CIDR block
  7. Exit

Enter the number corresponding to the action you want to perform and follow the prompts.

Requirements

  • Python 3

Installation

Clone this repository to your local machine:

git clone https://github.com/Dan-Duran/ip-calc.git && cd ip-calc/
python3 ip-calc.py

If you want colored output, install the termcolor library:

License

Releases

No releases published

Packages

No packages published

Languages