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.
- Host: GitHub
- URL: https://github.com/basecamp/composed_of_ipaddr
- Owner: basecamp
- License: mit
- Created: 2014-02-23T18:21:16.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2022-07-21T22:48:22.000Z (almost 4 years ago)
- Last Synced: 2025-07-18T05:34:44.505Z (11 months ago)
- Size: 4.88 KB
- Stars: 5
- Watchers: 33
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
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`.