On Mon, Jul 2, 2012 at 12:11 PM, Niall O'Reilly <niall.orei...@ucd.ie> wrote:
> On 2 Jul 2012, at 17:52, Nico Williams wrote:
>> So an IPv4 CIDR block like 10.2.93.128/25 would encode as x'0A025D81'
>> and 10.2.93.128/26 as x'0A025D82', and so on, with 10.2.93.128/32
>> encoded as x'0A025D8000' (that's 5 bytes).  That is, IPv4 addresses
>> would require one more byte than usual.
>
>         You're missing some cases which I would find indispensible.
>         I have a trip tomorrow.  I may be able to use the plane time
>         to think about your examples above and to put together some
>         complementary ones of my own.

Well, encoding bit strings (e.g., IP CIDR notation) as BLOBs is not at
all user-friendly.  But it does work for sorting.

A pair of built-in functions could take care of the user-friendliness
aspect to some degree, but built-in literals for bit string and IPv4/6
CIDR notation would so much more user-friendly...  IMO it's worth
doing.  It's really quite common to store IP addresses in relational
databases...

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

Reply via email to