From 4eccb9d87b793ad2b6e1532ef4c89ab9d2bb3a90 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 28 Dec 2012 16:37:46 -0500 Subject: Add random number functions to QUtil --- include/qpdf/QUtil.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index cdeefd71..8baedab6 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -83,6 +83,18 @@ namespace QUtil // encoding for the unicode value passed in. QPDF_DLL std::string toUTF8(unsigned long uval); + + // Wrapper around random from stdlib. Calls srandom automatically + // the first time it is called. + QPDF_DLL + long random(); + + // Wrapper around srandom from stdlib. + QPDF_DLL + void srandom(unsigned int seed); + + QPDF_DLL + void initializeWithRandomBytes(unsigned char* data, size_t len); }; #endif // __QUTIL_HH__ -- cgit v1.2.3-54-g00ecf