projects
/
platform
/
upstream
/
btrfs-progs.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Use a chunk of the key flags to record the item type.
[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
ret = btrfs_name_hash(line, strlen(line), &result);
19
BUG_ON(ret);
20
printf("hash returns %Lu\n", result);
21
}
22
return 0;
23
}