Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning.
10
votes
2
answers
9k
views
Reduce a list of IPv4 to lowest common CIDR
I have a long list of IP addresses that show some pattern of closeness
Example:
XX.249.91.16
XX.249.91.21
XX.249.91.32
XX.249.91.160
XX.249.91.165
XX.249.92.15
XX.249.92.25
XX.249.92.51 …
3
votes
Accepted
Reduce a list of IPv4 to lowest common CIDR
I have updated the solution which gave negative ints when using addresses with 255
fiddle
const dot2dec = ip => {
const octet = ip.split(".");
return (octet[0] * 16777216) + (octet[1] * 65536) + ( …