IPv6 bitwise math

Do the bitwise operators work on IPv6 addresses? If they do, I can’t figure out how. If I try to do a bitwise &, I get “Script Error: cannot compute bitwise “and” of internal number and time interval”. Likewise, a bitshift gives me “Script Error: cannot shift internal number right by time interval”.

I’m trying to get the prefix of an address from the address and the prefix size/netmask/cidr mask. I know it’s usually /64, and I could look for the 4th colon, but that isn’t necessarily a guarantee.

Bitwise operators do not work for IPv6 addresses. I mailed the support, they answered “to be aware of the issue, perhaps it will be fixed in the upcoming versions”.

So whoever needs this… Mail the support and let them know you need it!

Thanks for checking with support, and posting an update!

I’ll need to see if I can remember why I needed that, and whether or not I still do.