| 36 | } |
| 37 | |
| 38 | uint64_t sha1Hash(char *key, size_t len) { |
| 39 | SHA1_CTX ctx; |
| 40 | unsigned char hash[20]; |
| 41 | |
| 42 | SHA1Init(&ctx); |
| 43 | SHA1Update(&ctx,(unsigned char*)key,len); |
| 44 | SHA1Final(hash,&ctx); |
| 45 | uint64_t hash64; |
| 46 | memcpy(&hash64,hash,sizeof(hash64)); |
| 47 | return hash64; |
| 48 | } |
| 49 | |
| 50 | /* Test the hashing function provided as callback and return the |
| 51 | * number of collisions found. */ |
nothing calls this directly
no test coverage detected