#domain #matching #algorithm #intended

dmatcher

A simple domain matching algorithm, intended to be fast

10 releases

0.1.11 Nov 10, 2020
0.1.9 Nov 2, 2020
0.1.4 Oct 30, 2020

#100 in #matching

28 downloads per month

GPL-3.0 license

310KB
157 lines

This is a simple domain matching algorithm to match domains against a set of user-defined domain rules.

Features:

  • Super fast (197 ns per match for a 73300+ domain rule set)
  • No dependencies

Getting Started

use dmatcher::Dmatcher;
let mut matcher = Dmatcher::new();
matcher.insert("apple.com", "global").unwrap();
assert_eq!(matcher.matches("store.apple.com").unwrap(), Some("global".into()));

Dependencies

~8.5MB
~160K SLoC