ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-Knuddels/Net/Knuddels.pm
(Generate patch)

Comparing Net-Knuddels/Net/Knuddels.pm (file contents):
Revision 1.32 by root, Sun Jan 30 05:36:59 2005 UTC vs.
Revision 1.33 by root, Sun Jan 30 20:33:16 2005 UTC

20 20
21# TODO: anti-idle, immer oder optional 21# TODO: anti-idle, immer oder optional
22 22
23# TODO: send_james for james-messages 23# TODO: send_james for james-messages
24 24
25# TODO: Es wurde zu h\344ufig ein falsches Passwort beim Login verwendet.
26# TODO: _Falsches Passwort_ f\374r ich bin suess verwendet.
27# TODO: Dieser Channel ist auf _maximal 50_ Leute beschr\344nkt, bitte w\344hle einen anderen Channel.
28# TODO: Sie sind mit ihrem Nick in zuvielen Channels gleichzeitig eingeloggt. Schlie\337en Sie zuerst einen anderen Channel
29
25package Net::Knuddels; 30package Net::Knuddels;
26 31
27use Net::Knuddels::Dictionary; 32use Net::Knuddels::Dictionary;
28 33
29use strict; 34use strict;
52 my ($i, $j); 57 my ($i, $j);
53 58
54 --$l; 59 --$l;
55 60
56 if ($l <= 17) { 61 if ($l <= 17) {
57 for (0 .. $l) { 62 for my $x (0 .. $l) {
58 $i = _to32 $i * 3 + ord substr $xor, $l - $_; 63 $i = _to32 $i * 3 + ord substr $xor, $l - $x;
59 $j = _to32 $j * 5 + ord substr $xor, $_; 64 $j = _to32 $j * 5 + ord substr $xor, $x;
60 } 65 }
61 } else { 66 } else {
62 for ($_ = $l; $_ >= 0; $_ -= int $_/19) { 67 for (my $x = $l; $x >= 0; $x -= int +($l+1)/19) {
63 $i = _to32 $i * 5 + ord substr $xor, $_; 68 $i = _to32 $i * 5 + ord substr $xor, $x;
64 $j = _to32 $j * 3 + ord substr $xor, $l - $_; 69 $j = _to32 $j * 3 + ord substr $xor, $l - $x;
65 } 70 }
66 } 71 }
67 72
68 $i ^= $j; 73 $i ^= $j;
74
75 use integer; # force signed shift
69 _to32 (($i & 0xffffff) ^ ($i >> 24)) 76 _to32 (($i & 0xffffff) ^ ($i >> 24))
70} 77}
71 78
72my $RE_dec = join "|", keys %$Net::Knuddels::Dictionary; 79my $RE_dec = join "|", keys %$Net::Knuddels::Dictionary;
73 80

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines