Giter Club home page Giter Club logo

find-ip-primes's Introduction

Find Prime IP Addresses

About

A simple Python script by Jonathan Ellenberger that finds prime IP addresses.

Arguments

Required Arguments

  • ip_range_start: The start of the IP range to check for primes.
  • ip_range_end: The end of the IP range to check for primes.

Optional Arguments

  • --slice-start/-s: The start of the 'slice range' to calculate prime IPs from the overall IP range.
  • --slice-end/-e: The end of the 'slice range' to calculate prime IPs from the overall IP range.

Example Usage

To find prime IP addresses within a particular range of IPs, just past a start and end IP address:

$ python find_ip_address_primes.py 10.0.0.0 10.0.1.255
==================================================
Prime IP Addresses Between 10.0.0.0 and 10.0.1.255
==================================================
10.0.0.7
10.0.0.9
10.0.0.19
10.0.0.43
10.0.0.49
10.0.0.57
10.0.0.69
10.0.0.117
10.0.0.121
10.0.0.133
10.0.0.151
10.0.0.159
10.0.0.171
10.0.0.183
10.0.0.187
10.0.0.193
10.0.0.199
10.0.0.211
10.0.0.213
10.0.0.231
10.0.0.249
10.0.0.253
10.0.1.29
10.0.1.51
10.0.1.53
10.0.1.69
10.0.1.83
10.0.1.89
10.0.1.93
10.0.1.107
10.0.1.123
10.0.1.153
10.0.1.159
10.0.1.173
10.0.1.177
10.0.1.191
10.0.1.197
10.0.1.219
10.0.1.237

Slicing the IP Range

Unless you've got a super computer, large IP ranges will take a LOOONG time to calculate. In order to get a smaller slice from a large IP range you can pass the two optional arguments --slice-start and --slice-end to only calculate primes within a 'window' of the overall range:

$ python find_ip_address_primes.py 10.0.0.0 10.255.255.255 --slice-start=500 --slice-end=600
===================================================
Prime IP Addresses Between 10.0.1.244 and 10.0.2.88
---------------------------------------------------
(A Slice From IP Range: 10.0.0.0 - 10.255.255.255)
===================================================
10.0.0.25
10.0.0.49
10.0.0.79
10.0.0.83
10.0.0.91

find-ip-primes's People

Contributors

respondcreate avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.