Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2024-12-03 23:26:54


On Tue, Dec 3, 2024 at 2:46 PM Ivan Matek via Boost <boost_at_[hidden]>
wrote:

> 2) I am hashing one stream of bytes, but I do not have them all at the
> moment so I am passing it to hasher as they arrive(e.g. receiving long
> message over tcp, but hashing it as we get parts to minimize latency of
> computing hash after entire message is received)
>

The digest of a single binary blob should be calculated as-if first
submitting all the bytes to the hash function sequentially, and then
submitting the size of the blob in bytes as std::size_t. I don't think this
can be done through the type hashing interface and has to repeatedly call
instead the function which takes a void pointer and size. And at the end of
that, hashing a value of type `std::size_t`.

Thanks


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk