An open API service indexing awesome lists of open source software.

https://github.com/basecamp/composed_of_ipaddr

Compact IPv4 attributes for Active Record. Presents an unsigned int (4 bytes) as an IPAddr.
https://github.com/basecamp/composed_of_ipaddr

Last synced: 11 months ago
JSON representation

Compact IPv4 attributes for Active Record. Presents an unsigned int (4 bytes) as an IPAddr.

Awesome Lists containing this project

README

          

# Composed of IPAddr

Make it easier to store IPs in the db as 4-byte unsigned integers.
Indexes well and saves space over a varchar.

Pardon these implementation contortions. In our code, we can just work with an
`ipaddr` attribute using '1.2.3.4' strings and expect implicit coercion to
integers.

Requires an `int unsigned` column named `ipv4`.