VLC 4.0.0-dev
Loading...
Searching...
No Matches
MD5 hashing

APIs to hash data using the Message-Digest Algorithm 5 (MD5) More...

Collaboration diagram for MD5 hashing:

Data Structures

struct  vlc_hash_md5_ctx
 MD5 hash context. More...
 

Macros

#define VLC_HASH_MD5_DIGEST_SIZE   16
 MD5 digest output size.
 
#define VLC_HASH_MD5_DIGEST_HEX_SIZE   33
 MD5 digest hex representation size.
 

Typedefs

typedef struct vlc_hash_md5_ctx vlc_hash_md5_t
 MD5 hash context.
 

Functions

void vlc_hash_md5_Init (vlc_hash_md5_t *ctx)
 Initialize MD5 context.
 
void vlc_hash_md5_Update (vlc_hash_md5_t *ctx, const void *data, size_t size)
 Update MD5 hash computation with new data.
 
void vlc_hash_md5_Finish (vlc_hash_md5_t *ctx, void *output, size_t size)
 Finish MD5 hash computation.
 

Detailed Description

APIs to hash data using the Message-Digest Algorithm 5 (MD5)

Macro Definition Documentation

◆ VLC_HASH_MD5_DIGEST_HEX_SIZE

#define VLC_HASH_MD5_DIGEST_HEX_SIZE   33

MD5 digest hex representation size.

◆ VLC_HASH_MD5_DIGEST_SIZE

#define VLC_HASH_MD5_DIGEST_SIZE   16

MD5 digest output size.

Typedef Documentation

◆ vlc_hash_md5_t

MD5 hash context.

Function Documentation

◆ vlc_hash_md5_Finish()

void vlc_hash_md5_Finish ( vlc_hash_md5_t ctx,
void *  output,
size_t  size 
)

Finish MD5 hash computation.

Finishes the MD5 hash computation and provides the hash for the concatenation of all provided data by previous calls to vlc_hash_md5_Update. The result is written to the buffer pointed to by output, which must be at least VLC_HASH_MD5_DIGEST_SIZE big.

Parameters
[in,out]ctxMD5 hash context to finish
[out]outputOutput buffer to write to
sizeOutput buffer size

References vlc_hash_md5_ctx::md5_s::buf, md5_final(), vlc_hash_md5_ctx::priv, and VLC_HASH_MD5_DIGEST_SIZE.

Referenced by vlc_rand_bytes().

◆ vlc_hash_md5_Init()

void vlc_hash_md5_Init ( vlc_hash_md5_t ctx)

Initialize MD5 context.

Initializes the given MD5 hash function context, if the context is already initialized, it is reset.

Parameters
[out]ctxMD5 hash context to init

References md5_init(), and vlc_hash_md5_ctx::priv.

Referenced by ArtCacheGetDirPath(), AuthDigest(), GenerateCnonce(), InputSourceNew(), and vlc_rand_bytes().

◆ vlc_hash_md5_Update()

void vlc_hash_md5_Update ( vlc_hash_md5_t ctx,
const void *  data,
size_t  size 
)

Update MD5 hash computation with new data.

Updates the context with provided data which is used for the hash calculation. Can be called repeatedly with new data. The final hash represents the hash for the concatenation of all data.

Parameters
[in,out]ctxMD5 hash context to update
dataData to add
sizeSize of the data to add

References md5_write(), and vlc_hash_md5_ctx::priv.

Referenced by ArtCacheGetDirPath(), AuthDigest(), GenerateCnonce(), InputSourceNew(), and vlc_rand_bytes().