Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
5
-
c70c81b37 (dev), fa8256bb5 (dev), 2b6a77cd1 (dev)
-
Foundation Sprint 108
Description
Until now, QCryptographicHash had a big drawback over the underlying C APIs: at least one extra memory allocation. Either you created a QCryptographicHash object (allocates a Private), and enjoy noexcept addData() and resultView(), or you used the static hash() function (which creates a Private on the stack, so doesn't need to allocate it), but then we needed to return in an owning container.
Provide a hashInto() static function that can use the same Private-on-the-stack optimization that hash() has, but allows the user to pass a buffer to write into. This would be noexcept and could match the speed of the underlying C APIs.
Ditto QMessageAuthenticationCode.
Attachments
Issue Links
- resulted in
-
QTBUG-125514 Extend QCryptographicHash::hashInto() with hex/base64/percent-encoding options
- Open
-
QTBUG-125521 Have QCryptographicHash::hashInto() write directly into the supplied QSpan buffer
- In Progress