This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ Convert IPv4 range into CIDR | |
func iPv4RangeToCIDRRange(ipStart string, ipEnd string) (cidrs []string, err error) { | |
cidr2mask := []uint32{ | |
0x00000000, 0x80000000, 0xC0000000, | |
0xE0000000, 0xF0000000, 0xF8000000, | |
0xFC000000, 0xFE000000, 0xFF000000, | |
0xFF800000, 0xFFC00000, 0xFFE00000, | |
0xFFF00000, 0xFFF80000, 0xFFFC0000, | |
0xFFFE0000, 0xFFFF0000, 0xFFFF8000, |