MCPcopy Create free account
hub / github.com/3proxy/3proxy / nametohash

Function nametohash

src/auth.c:872–882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870
871
872void nametohash(const unsigned char * name, unsigned char *hash, unsigned char *rnd){
873 unsigned i, j, k;
874 memcpy(hash, rnd, sizeof(unsigned)*4);
875 for(i=0, j=0, k=0; name[j]; j++){
876 hash[i] += (toupper(name[j]) - 32)+rnd[((toupper(name[j]))*29277+rnd[(k+j+i)%16]+k+j+i)%16];
877 if(++i == sizeof(unsigned)*4) {
878 i = 0;
879 k++;
880 }
881 }
882}
883
884unsigned hashindex(struct hashtable *ht, const unsigned char* hash){
885 unsigned t1, t2, t3, t4;

Callers 2

hashaddFunction · 0.85
hashresolvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected