equal
deleted
inserted
replaced
907 $key = ''; |
907 $key = ''; |
908 for($i=0;$i<$len;$i++) |
908 for($i=0;$i<$len;$i++) |
909 { |
909 { |
910 $key .= chr(mt_rand(0, 255)); |
910 $key .= chr(mt_rand(0, 255)); |
911 } |
911 } |
912 if ( file_exists('/dev/urandom') && is_readable('/dev/urandom') ) |
912 if ( @file_exists('/dev/urandom') && @is_readable('/dev/urandom') ) |
913 { |
913 { |
914 // Let's use something a little more secure |
914 // Let's use something a little more secure |
915 $ur = @fopen('/dev/urandom', 'r'); |
915 $ur = @fopen('/dev/urandom', 'r'); |
916 if ( !$ur ) |
916 if ( !$ur ) |
917 return $key; |
917 return $key; |