md5.h File Reference

Routines for computing MD5 checksums. More...

`#include <stdint.h>`
`#include <stdlib.h>`

Go to the source code of this file.

## Data Structures

struct | md5_context_t

## Functions

void | md5_buffer (const void *buffer, size_t length, unsigned char digest[MD5_DIGEST_LENGTH])
| Checksum a memory buffer.
const char * | md5_to_string (unsigned char digest[MD5_DIGEST_LENGTH])
| Convert an MD5 digest into a printable string.
int | md5_file (const char *filename, unsigned char digest[MD5_DIGEST_LENGTH])
| Checksum a local file.

## Detailed Description

Routines for computing MD5 checksums.

## Function Documentation

## md5_buffer()

void md5_buffer | ( | const void * | buffer,
|  | size_t | length,
|  | unsigned char | digest[MD5_DIGEST_LENGTH] )

Checksum a memory buffer.

Note that this function produces a digest in binary form which must be converted to a human readable form with md5_to_string.

Parameters

  buffer | Pointer to a memory buffer.
  length | Length of the buffer in bytes.
  digest | Pointer to a buffer to store the digest.

## md5_to_string()

const char * md5_to_string | ( | unsigned char | digest[MD5_DIGEST_LENGTH] | ) |

Convert an MD5 digest into a printable string.

Parameters

  digest | A binary digest returned from md5_file, md5_buffer, or chirp_reli_md5.

Returns
  A static pointer to a human readable form of the digest.

## md5_file()

int md5_file | ( | const char * | filename,
|  | unsigned char | digest[MD5_DIGEST_LENGTH] )

Checksum a local file.

Note that this function produces a digest in binary form which must be converted to a human readable form with md5_to_string.

Parameters

  filename | Path to the file to checksum.
  digest | Pointer to a buffer to store the digest.

Returns
  One on success, zero on failure.