Re: [cryptopp-users] How to calculate hash of a string vector?

2022-02-02 Thread Jeffrey Walton
On Wed, Feb 2, 2022 at 12:19 PM Devharsh Trivedi wrote: > > I am trying to calculate SHA256 digest for entire string vector like this: > > byte digest[SHA256::DIGESTSIZE]; > SHA256().CalculateDigest(digest, (const byte*)stringVector.data(), > stringVector.size()); > > What is the correct way to c

[cryptopp-users] Re: How to calculate hash of a string vector?

2022-02-02 Thread Devharsh Trivedi
I am using hash.Update to iterate over a vector to calculate the hash of the container. Is there a better way to do this? std::string digest; SHA256 hash; for(auto str: stringVector) { hash.Update((const byte*)str.data(), str.size()); } digest.resize(hash.DigestSize()); hash.Final((byte*)&d

[cryptopp-users] How to calculate hash of a string vector?

2022-02-02 Thread Devharsh Trivedi
I am trying to calculate SHA256 digest for entire string vector like this: byte digest[SHA256::DIGESTSIZE]; SHA256().CalculateDigest(digest, (const byte*)stringVector.data(), stringVector.size()); What is the correct way to calculate hash of entire vector? -- You received this message because