6 namespace zypp {
namespace base {
11 static bool init =
false;
16 int fd = open(
"/dev/urandom", O_RDONLY|O_CLOEXEC);
17 if (fd < 0 || ::
read(fd, &seed,
sizeof(seed)) !=
sizeof(seed))
21 seed = rand()+time(0);
23 if (fd >= 0) close(fd);
32 if (length <=0 )
return std::string();
34 std::string
str;
str.resize( length );
String related utilities and Regular expression matching.
std::map< std::string, std::string > read(const Pathname &_path)
Read sysconfig file path_r and return (key,valye) pairs.
std::string random_string(int length)
Easy-to use interface to the ZYPP dependency resolver.
unsigned random()
Return a random number from [0,RAND_MAX[.