ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/AnyEvent-MP/MP/Kernel.pm
(Generate patch)

Comparing cvsroot/AnyEvent-MP/MP/Kernel.pm (file contents):
Revision 1.30 by root, Sun Aug 30 13:22:46 2009 UTC vs.
Revision 1.31 by root, Sun Aug 30 17:08:16 2009 UTC

112 if (open my $fh, "</dev/urandom") { 112 if (open my $fh, "</dev/urandom") {
113 sysread $fh, $nonce, $_[0]; 113 sysread $fh, $nonce, $_[0];
114 } else { 114 } else {
115 # shit... 115 # shit...
116 our $nonce_init; 116 our $nonce_init;
117 unless ($nonce_init++) { 117 unless ($nonce_init++) {
118 srand time ^ $$ ^ unpack "%L*", qx"ps -edalf" . qx"ipconfig /all"; 118 srand time ^ $$ ^ unpack "%L*", qx"ps -edalf" . qx"ipconfig /all";
119 } 119 }
120
121 $nonce = join "", map +(chr rand 256), 1 .. $_[0] 120 $nonce = join "", map +(chr rand 256), 1 .. $_[0]
122 } 121 }
123 122
124 $nonce 123 $nonce
125} 124}
133 62 132 62
134 ); 133 );
135 } else { 134 } else {
136 $data = MIME::Base64::encode_base64 $data, ""; 135 $data = MIME::Base64::encode_base64 $data, "";
137 $data =~ s/=//; 136 $data =~ s/=//;
137 $data =~ s/x/x0/g;
138 $data =~ s/\//s/g; 138 $data =~ s/\//x1/g;
139 $data =~ s/\+/p/g; 139 $data =~ s/\+/x2/g;
140 } 140 }
141 141
142 $data 142 $data
143} 143}
144 144

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines