<div dir="ltr">On Mon, Mar 14, 2016 at 12:45 PM, Konstantin Tokarev <span dir="ltr">&lt;<a href="mailto:annulen@yandex.ru" target="_blank">annulen@yandex.ru</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
I have cryptographic digest function which returns result in a form equivalent to const char* of known size.<br>
Is there any way to construct WTF::Vector&lt;uint8_t&gt; from it without resorting to memcpy?<br></blockquote><div><br></div><div>You mean like handing off the buffer?  I don&#39;t think Vector has such a capability at the moment.  We normally pre-allocate Vector buffer and call whatever function with that buffer in cases like this.  e.g.</div><div><br></div><div>Vector&lt;uint8_t&gt; digest;</div><div>digest.reserveInitialCapacity(digestSize);</div><div>cryptographicDigest(source, digest.data(), digest.size());</div><div><br></div><div>- R. Niwa</div><div><br></div></div></div></div>