Electroneum
Loading...
Searching...
No Matches
sha1 Namespace Reference

Functions

void calc (const void *src, const int bytelength, unsigned char *hash)
void toHexString (const unsigned char *hash, char *hexstring)

Function Documentation

◆ calc()

void sha1::calc ( const void * src,
const int bytelength,
unsigned char * hash )
Parameters
srcpoints to any kind of data to be hashed.
bytelengththe number of bytes to hash from the src pointer.
hashshould point to a buffer of at least 20 bytes of size for storing the sha1 result in.

◆ toHexString()

void sha1::toHexString ( const unsigned char * hash,
char * hexstring )
Parameters
hashis 20 bytes of sha1 hash. This is the same data that is the result from the calc function.
hexstringshould point to a buffer of at least 41 bytes of size for storing the hexadecimal representation of the hash. A zero will be written at position 40, so the buffer will be a valid zero ended string.