I am trying to generate a key from a given functions made by me, but I want to add randomize algorim without repetition similar as I do in python using secrets
, but how can I do it in c++? my variable seq
which store one , two , three, four
, but once I want to concatenate my functions to generate my key if I change to std::vector<std::string
my t it return an error of std::basic
int main(){
std::vector<std::string> seq{ "One", "Two", "Three", "Four" };
std::string t = reverse.ascii_lowercase() + reverse.ascii_uppercase() + reverse.digits() + reverse.punctuation();
std::cout << reverse.join(seq, "--") << std::endl;
std::cin.get();
}
t = string.ascii_lowercase + string.ascii_uppercase + string.digits + string.punctuation
key = ''.join([secrets.choice(t) for _ in range(20)])