blob: b7136650d331944fe2f0e7db1977bca0890ded3a [file] [log] [blame]
tylerliu01d63ca2020-10-06 16:29:23 -07001//
2// Created by Tyler on 10/6/20.
3//
4
5#include "assignment-random.hpp"
6#include <ndn-cxx/util/random.hpp>
7
8namespace ndn {
9namespace ndncert {
10
11_LOG_INIT(ndncert.assignment.random);
12NDNCERT_REGISTER_FUNCFACTORY(AssignmentRandom, "random");
13
14AssignmentRandom::AssignmentRandom()
15 : NameAssignmentFuncFactory("random")
16{
17}
18
19NameAssignmentFunc
20AssignmentRandom::getFunction(const std::string &factoryParam) {
21 return [](const std::vector<std::tuple<std::string, std::string>>){
22 std::vector<PartialName> names;
23 names.emplace_back(to_string(random::generateSecureWord64()));
24 return names;
25 };
26}
27
28}
29}