1
0
Fork 0

little hashing thing

master
Marrub 2015-10-09 01:15:57 +00:00
parent d7bdf3ed51
commit d20452893d
1 changed files with 16 additions and 0 deletions

16
hashchar.c Normal file
View File

@ -0,0 +1,16 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int main(int argc, char **argv)
{
int len = strlen(argv[1]);
size_t hash = 0;
for(int i = 0; i < len; i++)
{
hash = hash * 101 + argv[1][i];
}
printf("%zu\n", hash);
return 0;
}