Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include "md5.h"
- using namespace std;
- const string CHARACTERS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
- string RandomString() {
- string randstring = "";
- srand(time(NULL));
- for(int i = 0; i<32; i++) {
- randstring += CHARACTERS[rand() % 62];
- }
- return randstring;
- }
- int main () {
- time_t time_start = time(0);
- string value = "";
- for(int i = 0; i<1000000; i++) {
- value = md5(RandomString());
- }
- time_t time_end = time(0);
- time_t execution_time = (time_end - time_start);
- cout << execution_time;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement