From: jm Date: 2004-12-20T09:18:58+09:00 Subject: [ANN] Trie LCH -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (Darwin) iD8DBQFBxhq7EMczJf0zY5MRAq//AJwJ6atMnWe/JmX9pIAxH2mCWY8CywCfQg5/ n6RD+3vIJX1dX1DGOYXyJeI= =tYRp -----END PGP SIGNATURE-----