All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
random.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
7 #include "common.hpp"
8 
9 #include "random.hpp"
10 
11 #include "../security/cryptopp.hpp"
12 
13 namespace ndn {
14 namespace random {
15 
16 uint32_t
18 {
19  static CryptoPP::AutoSeededRandomPool rng;
20 
21  return rng.GenerateWord32();
22 }
23 
24 uint64_t
26 {
27  static CryptoPP::AutoSeededRandomPool rng;
28 
29  uint64_t random;
30 
31  rng.GenerateBlock(reinterpret_cast<unsigned char*>(&random), 8);
32 
33  return random;
34 }
35 
36 } // namespace random
37 } // namespace ndn
uint32_t generateWord32()
Definition: random.cpp:17
uint64_t generateWord64()
Definition: random.cpp:25