little hashing thing
parent
d7bdf3ed51
commit
d20452893d
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue