1 SourceT_n1 - hash teste 8bytes (ou e xor) Dom Jun 09, 2013 10:38 am
Moedas : 201
Mensagens : 92
Humor : *-*
Reputação : 5
Mensagens : 92
Humor : *-*
Reputação : 5
hacker fts315
- Código:
/*
by hacker fts315
SourceT_n1 - hash teste 8byts (ou e xor)
*/
#include <stdio.h>
#include <string.h>
int hasht1(const char *a)
{
unsigned int temp, cont = 0, temp2;
unsigned int hash = 10;
while(a[cont])
{
temp = (int) a[cont];
temp2 = 0;
hash = hash | temp;
temp2 = (int) hash / 2;
hash = hash ^ temp2;
cont++;
}
return hash;
}
int main(void)
{
printf("hacker fts315: %x\n",hasht1("hacker fts315"));
printf("hacker fts: %x\n",hasht1("hacker fts"));
printf("fts: %x\n",hasht1("fts"));
printf("hacker fts315: %x\n",hasht1("hacker fts315"));
}
uma hash simples de 8 bytes