Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "inc.h"
- int hash(char* string, int tsize) {
- int hash;
- int i, sum = 0;
- for (i = 0; string[i] != '\0'; ++i) {
- sum += (int) string[i];
- }
- hash = sum % tsize;
- return hash;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement