[vlc-devel] [PATCH v3 02/14] src: add cleaner md5 API
fcvlcdev at free.fr
Wed Apr 8 17:06:05 CEST 2020
Le 08/04/2020 à 16:56, Marvin Scholz a écrit :
> On 8 Apr 2020, at 16:54, Francois Cartegnie wrote:
>> Le 08/04/2020 à 16:10, Marvin Scholz a écrit :
>>> +void vlc_hash_md5_FinishHex(vlc_hash_md5_t *ctx, char *output,
>>> size_t size)
>>> + assert(size >= VLC_HASH_MD5_DIGEST_SIZE);
>>> + VLC_UNUSED(size);
>>> + md5_final(&ctx->priv);
>>> + vlc_hex_encode_binary(ctx->priv.buf, VLC_HASH_MD5_DIGEST_SIZE,
>>> + vlc_hash_md5_Init(ctx);
>> That's still creating an API for something not related to md5.
> And whats the issue with that?
> This is used in numerous places in VLC, so clearly it warrants a
> convenience function. It was there before this patchset too and no
> one had a problem with it?
That was pointed out at the beginning.
Binary to hex is not md5 specific. We don't need a new md5 api each time
we need a shortcut to do a different encoding. ex: base64
VideoLAN - VLC Developer
More information about the vlc-devel