| 728 | } |
| 729 | |
| 730 | static std::string generateStateString() |
| 731 | { |
| 732 | const char *chars = |
| 733 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"; |
| 734 | const size_t stateStringLen = 32; |
| 735 | |
| 736 | static std::random_device rd; |
| 737 | static std::mt19937 gen(rd()); |
| 738 | static std::uniform_int_distribution<size_t> dis(0, sizeof(chars) - 2); |
| 739 | |
| 740 | std::string state; |
| 741 | state.reserve(stateStringLen); |
| 742 | |
| 743 | for (size_t i = 0; i < stateStringLen; ++i) { |
| 744 | state += chars[dis(gen)]; |
| 745 | } |
| 746 | |
| 747 | return state; |
| 748 | } |
| 749 | |
| 750 | static std::string generateScopeString(const std::set<TokenOption> &options) |
| 751 | { |