Added an assertion which will trigger when number size wrong

This commit is contained in:
2014-04-23 14:15:46 +02:00
parent fb2164ca2d
commit 71f48c8220

View File

@ -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);