Functions | |
unsigned char * | qHashMd5 (const void *data, size_t nbytes) |
Get MD5 digested HEX string. | |
char * | qHashMd5Str (const void *data, size_t nbytes) |
Get MD5 digested ASCII string. | |
char * | qHashMd5File (const char *filepath, size_t *nbytes) |
Get MD5 digested ASCII string. | |
unsigned int | qHashFnv32 (unsigned int max, const void *data, size_t nbytes) |
Get FNV32 hash integer. |
unsigned char* qHashMd5 | ( | const void * | data, | |
size_t | nbytes | |||
) |
Get MD5 digested HEX string.
data | source object | |
nbytes | size of data |
unsigned char *md5 = qHashMd5((void*)"hello", 5); free(md5);
char* qHashMd5Str | ( | const void * | data, | |
size_t | nbytes | |||
) |
Get MD5 digested ASCII string.
data | source object | |
nbytes | size of data |
char *md5str = qHashMd5Str((void*)"hello", 5); printf("%sn", md5str); free(md5str);
char* qHashMd5File | ( | const char * | filepath, | |
size_t * | nbytes | |||
) |
Get MD5 digested ASCII string.
filepath | file path | |
nbytes | size of data. Set to NULL to digest end of file |
// case of digesting entire file char *md5str = qHashMd5File("/tmp/test.dat, NULL); printf("%sn", md5str); free(md5str); // case of nbytes is set to 1 bytes length size_t nbytes = 1; char *md5str = qHashMd5File("/tmp/test.dat, &nbytes); printf("%s %dn", md5str, nbytes); free(md5str); // case of nbytes is set to over size size_t nbytes = 100000; char *md5str = qHashMd5File("/tmp/test.dat, &nbytes); printf("%s %dn", md5str, nbytes); free(md5str);
unsigned int qHashFnv32 | ( | unsigned int | max, | |
const void * | data, | |||
size_t | nbytes | |||
) |
Get FNV32 hash integer.
max | hash range. 0 ~ (max-1). Set to 0 for full range | |
data | source data | |
nbytes | size of data |
unsigned int fnv32; fnv32 = qHashFnv32(0, (void*)"hello", 5); printf("%un", fnv32); fnv32 = qHashFnv32(1000, (void*)"hello", 5); printf("%un", fnv32);
[Home] [About] [Examples] [Changes] [Download] [SVN Repository] [Install] [Reference] |