Advertisement
Johurt

[FNC] GenerateRandomPassword

Apr 18th, 2015
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.76 KB | None | 0 0
  1. /*
  2.     By Johurt, 2015/04/18
  3. */
  4. stock GenerateRandomPassword(uncoded[], coded[])
  5. {
  6.     new sHEX[62] =
  7.     {
  8.         /* 0 - 9 */
  9.         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
  10.         /* A - Z */
  11.         0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A,
  12.         /* a - z*/
  13.         0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
  14.     };
  15.     format(uncoded, 9, "%c%c%c%c%c%c%c%c", sHEX[random(62)], sHEX[random(62)], sHEX[random(62)], sHEX[random(62)], sHEX[random(62)], sHEX[random(62)], sHEX[random(62)], sHEX[random(62)]);
  16.     format(coded, 33, "%s", MD5_Hash(uncoded));
  17.     return 1;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement