[ANN] Trie LCH

TrieLCH or Trie::LCH is a Trie with Level Compression and Hashing to be used in a manner similar to Hashes but with IP addresses as keys. This includes the use of the mask component of the IP address allowing you to store a value for a subnet and another for a subnet within that subnet.

Example
  trie = Trie::LCH.new()
  trie.add("192.168.0.0/24","network A")
  trie.add("192.168.0.128/25", "network B")
  trie.match("192.168.0.1") -> "network A"
  trie.match("192.168.0.32/8") -> "network A"
  trie.match("192.168.0.129") -> "network B"
  trie.match("10.0.0.0/8") -> nil

Alternatively,
  trie = Trie::LC.new()
  trie["192.168.0.0/24"] = "network A"
  trie["192.168.0.1"] -> "network A"

Homepage: http://ghostgun.com/software/trielch/

This is a quick release to make this package available to the wider community of ruby users. Trie::LCH lacks a delete() method making it unsuitable for some uses. Having said that it should still prove useful to anyone working with IP addresses.

Jeff.