From 0de702218fe446ccf8342e41ce32dff871b03fdd Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 17 Jul 2002 17:06:44 +0000 Subject: moved makeHash to Tools --- Echolot/Pinger.pm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'Echolot/Pinger.pm') diff --git a/Echolot/Pinger.pm b/Echolot/Pinger.pm index 18f72f9..57efaa8 100644 --- a/Echolot/Pinger.pm +++ b/Echolot/Pinger.pm @@ -1,7 +1,7 @@ package Echolot::Pinger; # (c) 2002 Peter Palfrader -# $Id: Pinger.pm,v 1.15 2002/07/17 16:14:23 weasel Exp $ +# $Id: Pinger.pm,v 1.16 2002/07/17 17:06:44 weasel Exp $ # =pod @@ -22,15 +22,6 @@ use English; use Echolot::Pinger::Mix; use Echolot::Pinger::CPunk; -sub makeHash($) { - my ($text) = @_; - - my $hash = Echolot::Tools::make_mac($text); - $hash = substr($hash, 0, 4); - my $sum = hex($hash); - return $sum; -}; - sub do_mix_ping($$$$$) { my ($address, $keyid, $time, $to, $body) = @_; @@ -109,7 +100,7 @@ sub send_pings() { for my $type (Echolot::Globals::get()->{'storage'}->get_types($address)) { next unless Echolot::Config::get()->{'do_pings'}->{$type}; for my $key (Echolot::Globals::get()->{'storage'}->get_keys($address, $type)) { - next unless ($this_call_id eq (makeHash($address.$type.$key) % $send_every_n_calls)); + next unless ($this_call_id eq (Echolot::Tools::makeShortNumHash($address.$type.$key) % $send_every_n_calls)); print "ping calling $type, $address, $key\n" if Echolot::Config::get()->{'verbose'}; do_ping($type, $address, $key); } -- cgit v1.2.3