MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / getHashAndReset

Method getHashAndReset

tests/common/HashMD5.cpp:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53std::array<uint8_t, 16> HashMD5::getHashAndReset()
54{
55 unsigned char buf[EVP_MAX_MD_SIZE];
56 unsigned int nwritten = sizeof(buf);
57 // it also resets the context
58 int ret = EVP_DigestFinal(pimpl->ctx, buf, &nwritten);
59 NVCV_ASSERT(ret == 1);
60
61 // Be ready for a new run
62 ret = EVP_DigestInit_ex(pimpl->ctx, EVP_md5(), NULL);
63 NVCV_ASSERT(ret == 1);
64
65 NVCV_ASSERT(nwritten == 16);
66 std::array<uint8_t, 16> hash;
67 memcpy(&hash[0], buf, sizeof(hash));
68 return hash;
69}
70
71void Update(HashMD5 &hash, const char *value)
72{

Callers 2

TESTFunction · 0.80
GetTestParamHashHelperFunction · 0.80

Calls

no outgoing calls

Tested by 2

TESTFunction · 0.64
GetTestParamHashHelperFunction · 0.64