Advertisement
Guest User

Untitled

a guest
Sep 10th, 2014
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include "md5.h"
  4. using namespace std;
  5.  
  6. const string CHARACTERS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  7.  
  8. string RandomString() {
  9. string randstring = "";
  10. srand(time(NULL));
  11. for(int i = 0; i<32; i++) {
  12. randstring += CHARACTERS[rand() % 62];
  13. }
  14. return randstring;
  15. }
  16.  
  17. int main () {
  18. time_t time_start = time(0);
  19.  
  20. string value = "";
  21. for(int i = 0; i<1000000; i++) {
  22. value = md5(RandomString());
  23. }
  24. time_t time_end = time(0);
  25. time_t execution_time = (time_end - time_start);
  26. cout << execution_time;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement