File fix_incorrectly_generated_algbyval_table.patch of Package perl-Net-DNS

diff --git a/lib/Net/DNS/RR/TSIG.pm b/lib/Net/DNS/RR/TSIG.pm
index 97ddc79..7731057 100644
--- a/lib/Net/DNS/RR/TSIG.pm
+++ b/lib/Net/DNS/RR/TSIG.pm
@@ -48,16 +48,16 @@ use constant TSIG => typebyname qw(TSIG);
 		'HMAC-SHA' => 161,
 		);
 
-	my %algbyname = map { s /[^A-Za-z0-9]//g; $_ } @algbyalias, @algbyname;
 	my %algbyval = reverse @algbyname;
 
+	my @algbynum = map { ( $_, 0 + $_ ) } keys %algbyval;	# accept algorithm number
+
+	my %algbyname = map { s /[^A-Za-z0-9]//g; $_ } @algbyalias, @algbyname, @algbynum;
 
 	sub algbyname {
-		my $name = shift;
-		my $key	 = $name;				# synthetic key
-		$key =~ s /[^A-Za-z0-9]//g;			# strip non-alphanumerics
-		return 0 + $name unless $key =~ /\D/;		# accept algorithm number
-		return $algbyname{uc $key};
+		my $key = uc shift;				# synthetic key
+		$key =~ s /[^A-Z0-9]//g;			# strip non-alphanumerics
+		return $algbyname{$key};
 	}
 
 	sub algbyval {
openSUSE Build Service is sponsored by