Added an assertion which will trigger when number size wrong
This commit is contained in:
@ -25,6 +25,7 @@
|
||||
#include <dynstring.h>
|
||||
#include <mxml.h>
|
||||
|
||||
|
||||
extern char *trim(char *);
|
||||
|
||||
typedef struct {
|
||||
@ -141,6 +142,8 @@ static long long calculateToken(char *password, long long hash)
|
||||
long long tmp;
|
||||
int i;
|
||||
|
||||
assert(sizeof(hash) == 8);
|
||||
|
||||
tmp = hash ^ 0x80AA80AA;
|
||||
for(i = 0; i < strlen(password); i++){
|
||||
tmp += password[i] * (long long)pow(2,i);
|
||||
|
Reference in New Issue
Block a user