18 const char charset[] =
20 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
21 "abcdefghijklmnopqrstuvwxyz";
22 const size_t max_index = (
sizeof(charset) - 1);
26 str.push_back(charset[rand() % max_index]);
36 return std::make_optional<base::SimpleToken>(str);
std::string ToString() const
static SimpleToken Create()
size_t SimpleTokenHash(const SimpleToken &SimpleToken)
constexpr size_t kRandomTokenLength
std::optional< base::SimpleToken > ValueToSimpleToken(std::string str)
std::string SimpleTokenToValue(const SimpleToken &token)
std::ostream & operator<<(std::ostream &out, const SimpleToken &token)