Results 1 to 1 of 1
  1. #1
    FoxLife
    FoxLife is offline
    New member FoxLife's Avatar
    Join Date
    2013 Apr
    Posts
    20
    Thanks Thanks Given 
    4
    Thanks Thanks Received 
    16
    Thanked in
    9 Posts
    Rep Power
    0

    Generate Random Password-Delphi

    This is a simple tip and for working with wireless networks can be very useful. What function does is generate a string of hexadecimal characters, but can be adapted for any other type. This function takes as parameters the password length as an integer, and three parameters of type boolean indicating whether these are lowercase, uppercase and numbers.

    PHP Code:
    GeraSenhaHex function (DigitsIntegerMinBooleanMaiBooleanNumBoolean): string;
    const
    MinC 'abcdef';
    MAIC 'abcdef';
    NUMC '1234567890 ';
    var
    pqInteger;
    CharPasswordString;
    begin
    Char
    : ='';
    If 
    Char then Min: = Char MinC;
    If 
    Mai then CharChar = + MAIC;
    If 
    a then CharChar = + NUMC;
    for 
    p: = 1 to the Digits
       begin
         Randomize
    ;
         
    q: = Random (Length (Char)) + 1;
         
    PasswordPassword = + Char [q];
       
    end;
    Result: = Password;
    end
    explanations:

    First we create the constant that will bring the characters referring to lowercase, uppercase, numbers and then began to empty, only by discharge of consciousness since Delphi does this by default, the variable "Char", which will contain all the characters be used for random password generation.

    After that, we test parameters to uppercase, lowercase and numbers, adding to the "Char" each of which are true according to the parameters passed in function call.

    And then, to finish, a tie with the number of repetitions equal to the digits also passed as a parameter in the call that function using the Random delphi generates random numbers within the limit set by the variable performance of "Char", noting that the fact add "+ 1" is for the positions of characters within a string start at 1, and the function generates Random numbers from 0 up to the amount stipulated as the limit. For example a String = 'test' have the following values​​:

    String [1] = 't'
    String [2] = 'e'
    String [3] = 's'
    String [4] = 't'
    String [5] = 'e'


    Finished. Simple, easy and very useful.

  2. The Following User Says Thank You to FoxLife For This Useful Post:


Similar Threads

  1. [Help] Internal Password
    By ferzikaa in forum Aika Bots, Hacks, Cheats
    Replies: 2
    Last Post: 2012-08-19, 08:37 PM
  2. [Delphi] Delphi elementclient inject
    By marcelo380 in forum Perfect World
    Replies: 0
    Last Post: 2012-06-08, 09:13 PM
  3. [Help] Password
    By jonas2 in forum Aika Online
    Replies: 7
    Last Post: 2012-04-16, 01:31 AM
  4. [Release] Aika br no xtrap without password
    By rodoxfnx in forum Aika Bots, Hacks, Cheats
    Replies: 7
    Last Post: 2012-01-11, 07:11 AM
  5. [Delphi] Delphi Training Video
    By Dwar in forum Programming Tutorials
    Replies: 0
    Last Post: 2010-11-29, 04:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •