generations on headers
[platform/upstream/btrfs-progs.git] / hasher.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include "kerncompat.h"
5 #include "hash.h"
6
7 int main() {
8         u64 result;
9         int ret;
10         char line[255];
11         char *p;
12         while(1) {
13                 p = fgets(line, 255, stdin);
14                 if (!p)
15                         break;
16                 if (strlen(line) == 0)
17                         continue;
18                 if (line[strlen(line)-1] == '\n')
19                         line[strlen(line)-1] = '\0';
20                 ret = btrfs_name_hash(line, strlen(line), &result);
21                 BUG_ON(ret);
22                 printf("hash returns %Lu\n", result);
23         }
24         return 0;
25 }