View source for Module:Sensitive IP addresses/summary
MyWikiBiz, Author Your Legacy — Saturday March 29, 2025
Jump to navigationJump to searchYou do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
local mSIPA_API = require('Module:Sensitive IP addresses/API')
local yesno = require('Module:Yesno')
local p = {}
-- Strips a suffix from a CIDR string if the suffix is of a given bitLength.
-- bitLength must be either 32 or 128.
-- This is intended to allow CIDR strings to be represented as a single IP
-- address if this can be done unambiguously.
local function stripCIDRSuffix(cidr, bitLength)
assert(bitLength == 32 or bitLength == 128, 'bitLength was not 32 or 128')
local pattern = '/' .. bitLength .. '$'
cidr = cidr:gsub(pattern, '')
return cidr
end
-- Takes an array of CIDR ranges and returns a new array with ranges
-- appropriate for printing.
local function prettifyRanges(ranges, bitLength)
local ret = {}
for i, cidr in ipairs(ranges) do
000
1:0
Templates used on this page:
- Template:Tag (view source)
- Template:Used in system (view source)
- Module:Arguments (view source)
- Module:IP (view source)
- Module:No globals (view source)
- Module:Sensitive IP addresses/API (view source)
- Module:Sensitive IP addresses/list (view source)
- Module:Sensitive IP addresses/summary (view source)
- Module:Sensitive IP addresses/summary/doc (view source)
- Module:Yesno (view source)
Return to Module:Sensitive IP addresses/summary.