<html><head></head><body>Hi,<br><br>If you add a parameter, there's no way to make the init function not allocate memory and return void. I much prefer this specific Nettle style over the generic gcrypt style (at least in C).<br><br><div class="gmail_quote">Le 2 avril 2020 01:39:41 GMT+03:00, Francois Cartegnie <fcvlcdev@free.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Le 01/04/2020 à 21:47, Marvin Scholz a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">+static inline void vlc_hash_BinToHex(void *input, size_t size, char *output)<br>+{<br>+    unsigned char *buffer = input;<br>+<br>+    for (size_t i = 0; i < size; i++) {<br>+        sprintf(&output[i * 2], "%02" PRIx8, buffer[i]);<br>+    }<br></blockquote><br>I don't think bin2hex belongs to a specific API.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">+vlc_hash_md5_Init<br>+vlc_hash_md5_Update<br>+vlc_hash_md5_Finish<br>+vlc_hash_md5_FinishHex<br></blockquote>If you add a parameter you won't need a new API for a new hash type<br></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>