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

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

XMLWordPrintable

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

      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

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

            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

              Created:
              Updated:

                There are no open Gerrit changes