Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/zhanghjster/ip-match-trie

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/zhanghjster/ip-match-trie

  • v0.0.0-20170903020429-6e75d52eeedc
  • Source
  • Go
  • Socket score

Version published
Created
Source

IPMatchTrie

Data structrue and algorithm for matching IP address against Net ranges.

IPMatchTrie use Trie data structure, it has super fast lookup time but slow setup. It is usefull for one setup but long time running service.

Only IPv4 supported

Usage

Create a Matcher

	m := IPMatchTrie.New()

Add ip range(CIDR) and value

	err := m.Add("1.2.3.0/24", "hello")

Find value of the ip range the ip fall into

 	v, err := m.Find("1.2.3.4")

License

MIT

FAQs

Package last updated on 03 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc