Tester program
This commit is contained in:
parent
18491a1336
commit
c6e84189e6
1 changed files with 11 additions and 0 deletions
11
lookup3.c
11
lookup3.c
|
|
@ -1,5 +1,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
|
#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
|
||||||
|
|
||||||
|
|
@ -61,3 +63,12 @@ uint32_t lookup3(const void *key, size_t length, uint32_t initval) {
|
||||||
final(a, b, c);
|
final(a, b, c);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
char *a = "Hello!\0";
|
||||||
|
int len = strlen(a);
|
||||||
|
|
||||||
|
uint32_t hash = lookup3(a, len, 0);
|
||||||
|
|
||||||
|
printf("%.8X\n", hash);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue