TheAlgorithms-C/hash/test_program.c

21 lines
442 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)
{
2020-03-07 23:45:24 +08:00
char s[] = "hello";
2018-01-01 05:58:30 +08:00
/* actual tests */
2020-03-07 23:45:24 +08:00
printf("sdbm: %s --> %llX\n", s, sdbm(s));
printf("djb2: %s --> %llX\n", s, djb2(s));
printf("xor8: %s --> %X\n", s, xor8(s)); /* 8 bit */
printf("adler_32: %s --> %X\n", s, adler_32(s)); /* 32 bit */
2018-01-01 05:58:30 +08:00
return 0;
2020-03-07 23:45:24 +08:00
}