btrfs-progs/hasher.c

26 lines
480 B
C
Raw Normal View History

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kerncompat.h"
#include "hash.h"
int main() {
u64 result;
int ret;
char line[255];
char *p;
while(1) {
p = fgets(line, 255, stdin);
if (!p)
break;
if (strlen(line) == 0)
continue;
2007-03-26 15:24:42 +00:00
if (line[strlen(line)-1] == '\n')
line[strlen(line)-1] = '\0';
ret = btrfs_name_hash(line, strlen(line), &result);
BUG_ON(ret);
2007-06-12 12:08:04 +00:00
printf("hash returns %llu\n", (unsigned long long)result);
}
return 0;
}