nieco viac

This commit is contained in:
Radovan Kofira 2020-11-10 19:58:36 +01:00
parent 328330c552
commit 34fa8cae4e

View File

@ -27,13 +27,14 @@ void destroy_station(struct station* station){
} }
int select_track(struct station* station, const char* target){ int select_track(struct station* station, const char* target){
unsigned char *str; unsigned long
hash(unsigned char *str)
{ {
unsigned long hash = 0; unsigned long hash = 5381;
int c; int c;
while (c = *str++) while (c = *str++)
hash = c + (hash << 6) + (hash << 16) - hash; hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
return hash; return hash;
} }