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

Add QCryptographicHash::{hash,result}Into()

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • None

    Description

      See epic for context.

      The goal here is to get efficiency on par with the underlying C APIs.

      We already have resultView(), but this has two problems:

      • holds the data in an internal buffer from which it needs to be copied by the user to persistent storage before the QCH object is destroyed
      • in particular, and this is the second point, it doesn't work for the static hash() short-cut
        • the internal buffer doesn't survive the function call, so we need to return by QByteArray

      The idea of -Into() is to bypass the internal buffer and use a user-provided one.

      Acceptance criteria:

      • hash() and result() have -Into() versions that allow the user to pass a destination buffer
        • as QByteArray*
        • as QSpan<std::byte> / QMutableByteArrayView (both would need to be written first)
      • hashInto() does not copy the result
        • doesn't use Private::result at all

      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:

                Gerrit Reviews

                  There are no open Gerrit changes