7 namespace zypp {
namespace base {
12 static bool init =
false;
17 int fd = open(
"/dev/urandom", O_RDONLY|O_CLOEXEC);
18 if (fd < 0 || ::
read(fd, &seed,
sizeof(seed)) !=
sizeof(seed))
22 seed = rand()+time(0);
24 if (fd >= 0) close(fd);
33 if (length <=0 )
return std::string();
35 std::string str; str.resize( length );
map< string, string > read(const Pathname &_path)
Read sysconfig file path_r and return (key,valye) pairs.
std::string random_string(int length)
unsigned random()
Return a random number from [0,RAND_MAX[.