blob: 88e9a914eda585d561b4320468a0247ce2b99886 [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
tylerliu01d63ca2020-10-06 16:29:23 -070011NDNCERT_REGISTER_FUNCFACTORY(AssignmentRandom, "random");
12
Zhiyi Zhang8683ec92020-10-07 18:18:35 -070013AssignmentRandom::AssignmentRandom(const std::string& format)
14 : NameAssignmentFuncFactory("random", format)
15{}
tylerliu01d63ca2020-10-06 16:29:23 -070016
Zhiyi Zhang8683ec92020-10-07 18:18:35 -070017std::vector<PartialName>
18AssignmentRandom::assignName(const std::vector<std::tuple<std::string, std::string>>& params)
19{
20 std::vector<PartialName> resultList;
21 resultList.emplace_back(to_string(random::generateSecureWord64()));
22 return resultList;
tylerliu01d63ca2020-10-06 16:29:23 -070023}
24
25}
26}