TheAlgorithms-C/hash/test_program.c

22 lines
492 B
C
Raw Normal View History

2018-01-01 05:58:30 +08:00
/*
author: Christian Bender
This file contains a simple test program for each hash-function.
*/
#include <stdio.h>
#include "hash.h"
int main(void)
{
char s[] = "name";
/* actual tests */
printf("sdbm: %s --> %lld\n", s, sdbm(s));
printf("djb2: %s --> %lld\n", s, djb2(s));
printf("xor8: %s --> %i\n", s, xor8(s)); /* 8 bit */
printf("adler_32: %s --> %i\n", s, adler_32(s)); /* 32 bit */
2019-10-13 18:13:00 +08:00
printf("crc32: %s --> %i\n", s, crc32(s));
2019-10-14 23:49:03 +08:00
2018-01-01 05:58:30 +08:00
return 0;
}