<commit_before><commit_msg>add cache util file (route deduping with ttls)<commit_after>module.exports = {
  route : new routeCache()
}

// when routing, we need to keep a 1-min cache to dedup any circular routes
var dedup = {};
setInterval(function dedupt(){dedup={}},60*1000);

function route(){
  this._routes = {};
  return this;
}

route.prototype.insert = function route_insert(packet){
  var tok = crypto.createHash('sha256').update(packet).digest('hex');
  var routes = this._routes
  setTimeout(function(){
    delete routes[tok]
  },60 * 1000)
  if (routes[tok])
    return false;
  else
    return (routes[tok] = true);
}

{'fraction_non_alphanumeric': 0.14240506329113925, 'fraction_numerical': 0.02531645569620253, 'mean_word_length': 4.410256410256411, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '719238', 'n_tokens_mistral': 213, 'n_tokens_neox': 202, 'n_words': 56}