blob: 9ebf45f0ce18d29ef2cd67befef51304b1a7cca0 [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);
tylerliuafb27a02020-10-06 17:20:06 -070012
tylerliu01d63ca2020-10-06 16:29:23 -070013NDNCERT_REGISTER_FUNCFACTORY(AssignmentRandom, "random");
14
15AssignmentRandom::AssignmentRandom()
16 : NameAssignmentFuncFactory("random")
17{
18}
19
20NameAssignmentFunc
21AssignmentRandom::getFunction(const std::string &factoryParam) {
22 return [](const std::vector<std::tuple<std::string, std::string>>){
23 std::vector<PartialName> names;
24 names.emplace_back(to_string(random::generateSecureWord64()));
25 return names;
26 };
27}
28
29}
30}