Shuo-Jia commented on a change in pull request #842:
URL: https://github.com/apache/incubator-pegasus/pull/842#discussion_r757346702



##########
File path: src/test/function_test/utils.h
##########
@@ -30,3 +33,50 @@
             }                                                                  
                    \
         }                                                                      
                    \
     } while (0)
+
+inline std::string generate_random_str(uint32_t str_len = 20)
+{
+    static const std::string chars("abcdefghijklmnopqrstuvwxyz"
+                                   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                   "1234567890");
+    std::string result;
+    for (int i = 0; i < str_len; i++) {
+        result += chars[dsn::rand::next_u32(chars.size())];
+    }
+    return result;
+}

Review comment:
       consider add the function into `dsn::rand` as `common` function




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to