08.07.2013, 22:39
Код:
#define MAX_SALT_LENGTH 128 stock WhirlpoolHashUnique(string[], times, salt[MAX_SALT_LENGTH] = "", bool: iter_append = false, salt_length = 10) { new stringTaken[258]; new realsalt [MAX_SALT_LENGTH]; //here i miss c++ if (salt[0] == '\0') { randomString(realsalt, salt_length); } else realsalt = salt; if(!iter_append) { strcat(stringTaken, string, 258); strcat(stringTaken, realsalt, 258); for(new i = 0; i < times; i++) WP_Hash(stringTaken, 258, stringTaken); } else { strcat(stringTaken, string); for(new i = 0; i < times; i++) { strcat(stringTaken, realsalt); WP_Hash(stringTaken, 258, stringTaken); } } return stringTaken; }
Quote:
WhirlpoolHashUnique("Hello world", 4, "Hello"); WhirlpoolHashUnique("Hello world", 4); |
I used MAX_SALT_LENGTH to avoid error for
"
realsalt = salt;
"
ofc, you can use ofc a different way.