Florian Weimer wrote:
>
> Is this Java or C?  For C, this breaks if network_size == 32.
>   

It is SQL (with SQLite extensions which are modeled after C).  SQLite 
has a 64 bit integer type so the bit shifting works as expected for all 
values up to 63. The same logic can be used in other languages.

This was intended to work for IPv4 addresses only as shown in the OP 
example. For these addresses the practical range of network width is 
from 2, not really very practical, but a legal minimum subnet width, to 
25, the entire range of a class A network.

Dennis Cote


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to