Rev 14 | Rev 57 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 14 | Rev 22 | ||
---|---|---|---|
Line 859... | Line 859... | ||
859 | 859 | ||
860 | // hash the supplied e-mail |
860 | // hash the supplied e-mail |
861 | correct_activationcode = 5381; // start value |
861 | correct_activationcode = 5381; // start value |
862 | for (byte_index = 0; byte_index < sizeof (crackermsg) - 1; byte_index++) |
862 | for (byte_index = 0; byte_index < sizeof (crackermsg) - 1; byte_index++) |
863 | correct_activationcode = ((correct_activationcode << 5) + correct_activationcode) |
863 | correct_activationcode = ((correct_activationcode << 5) + correct_activationcode) |
864 | + ((unsigned long) (length > 0 ? towlower (email[byte_index % length]) : |
864 | + ((unsigned long) (length > 0 ? towlower (email[byte_index % length]) : 1) // prevent zero divide |
865 | ^ (unsigned long) crackermsg[byte_index]); // hash = hash * 33 + (char(email) ^ char(crackermsg)) |
865 | ^ (unsigned long) crackermsg[byte_index]); // hash = hash * 33 + (char(email) ^ char(crackermsg)) |
866 | correct_activationcode &= 0x7FFFFFFF; // make sure the results remain positive |
866 | correct_activationcode &= 0x7FFFFFFF; // make sure the results remain positive |
867 | 867 | ||
868 | // as usuals, it alls boils down to a single test :( |
868 | // as usuals, it alls boils down to a single test :( |
869 | return ((length > sizeof ("a@b.c") - 1) && (code == correct_activationcode)); |
869 | return ((length > sizeof ("a@b.c") - 1) && (code == correct_activationcode)); |