Also fixed a typo in main.go.
Works with every IP (whether v4 or v6) in the Googlebot pool
To elaborate on the comments I included if anyone in the future sees this (and so I understand it better):
11111111 11111111 11111111 11110000 is the mask of a IPv4 CIDR block of /28, meaning it is in total 32 bits long and has 4 empty bits.
emptyBits ** 2 is the amount of IPs in that block.
So if we had 34.100.182.96/28, our range is 34.100.182.[96-111].
The same premise works for IPv6 addresses, the mask just increases to a size of 64 bits.
Also fixed a typo in
main.go
. Works with every IP (whether v4 or v6) in the Googlebot poolTo elaborate on the comments I included if anyone in the future sees this (and so I understand it better):
11111111 11111111 11111111 11110000
is the mask of a IPv4 CIDR block of /28, meaning it is in total 32 bits long and has 4 empty bits.emptyBits ** 2
is the amount of IPs in that block. So if we had34.100.182.96/28
, our range is34.100.182.[96-111]
. The same premise works for IPv6 addresses, the mask just increases to a size of 64 bits.