1: #include <ctype.h>
2:
3: unsigned short
4: hashpass(hpw)
5: char *hpw;
6: {
7: long hash;
8: register char c;
9:
10: hash = 0;
11: while ((c = *hpw++) != '\0') {
12: hash = (hash*65536) + (isupper(c) ? tolower(c) : c);
13: hash %= 65357;
14: }
15: return((unsigned short) hash);
16: }