Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-125431

Add QCryptographicHash::hashInto(QSpan<std::byte>)

    XMLWordPrintable

Details

    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mmutz Marc Mutz
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes