16 static char saltchars[] =
17 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
18 char salt[3], *result;
20 salt[0] = saltchars[random() % (
sizeof(saltchars) - 1)];
21 salt[1] = saltchars[random() % (
sizeof(saltchars) - 1)];
24 result = crypt(str, salt);
40 static char saltchars[] =
41 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
42 char salt[12], *result;
48 for (
int i = 3; i < 11; ++i)
49 salt[i] = saltchars[random() % (
sizeof(saltchars) - 1)];
53 result = crypt(str, salt);