* internal hash function, calling * the basic methods from md5.h */
| 34 | * the basic methods from md5.h |
| 35 | */ |
| 36 | std::string md5wrapper::hashit(unsigned char *data, size_t length) |
| 37 | { |
| 38 | MD5Context ctx; |
| 39 | |
| 40 | //init md5 |
| 41 | MD5Init(&ctx); |
| 42 | //update with our string |
| 43 | MD5Update(&ctx, data, length); |
| 44 | |
| 45 | //create the hash |
| 46 | unsigned char buff[16] = ""; |
| 47 | MD5Final((unsigned char*)buff,&ctx); |
| 48 | |
| 49 | //converte the hash to a string and return it |
| 50 | return convToString(buff); |
| 51 | } |
| 52 | |
| 53 | /* |
| 54 | * converts the numeric hash to |
no test coverage detected