Iprange
IPRange - Redis as a storage for IP range
Install / Use
/learn @globocom/IprangeREADME
IPRange
Store IP Ranges in Redis as sorted sets for fast retrieval
Installation
Add this line to your application's Gemfile:
gem 'iprange'
And then execute:
$ bundle
Or install it yourself as:
$ gem install iprange
Usage
> redis_config = {host: "127.0.0.1"}
> range = IPRange::Range.new(redis_config)
> range.add("192.168.0.1/24", some: "data", more: "metadata")
> range.find("192.168.0.20")
=> {:range=>"192.168.0.1/24", "some"=>"data", "more"=>"metadata"}
Notice
This gem relies on a Redis fork that implements interval sets, as described in this blog post.
If your intervals do not, you can try the tag v0.0.1, which uses sorted sets instead of inverval sets.
Contributing
- Fork it ( http://github.com/globocom/iprange/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
