cctools
|
Routines for computing SHA1 checksums. More...
#include <stdint.h>
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
struct | sha1_context_t |
Functions | |
void | sha1_buffer (const void *buffer, size_t length, unsigned char digest[SHA1_DIGEST_LENGTH]) |
Checksum a memory buffer. More... | |
int | sha1_file (const char *path, unsigned char digest[SHA1_DIGEST_LENGTH]) |
Checksum a local file. More... | |
const char * | sha1_string (unsigned char digest[SHA1_DIGEST_LENGTH]) |
Convert an SHA1 digest into a printable string. More... | |
Routines for computing SHA1 checksums.
void sha1_buffer | ( | const void * | buffer, |
size_t | length, | ||
unsigned char | digest[SHA1_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 sha1_string.
buffer | Pointer to a memory buffer. |
length | Length of the buffer in bytes. |
digest | Pointer to a buffer to store the digest. |
int sha1_file | ( | const char * | path, |
unsigned char | digest[SHA1_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 sha1_string.
path | Path to the file to checksum. |
digest | Pointer to a buffer to store the digest. |
const char* sha1_string | ( | unsigned char | digest[SHA1_DIGEST_LENGTH] | ) |
Convert an SHA1 digest into a printable string.
digest | A binary digest returned from sha1_file. |