Results 1 to 3 of 3

Thread: What should be value of pass variable?

  1. #1

    Thread Starter
    Junior Member gopi_vbboy's Avatar
    Join Date
    Nov 2006
    Location
    India
    Posts
    31

    What should be value of pass variable?

    Consider this javascipt code:

    [pass is a unknown variable n assume declared]
    -------------------

    var temp = 0;
    var alpha = "abcdefghijklmnopqrstuvwxyz";
    var char1;
    for (i = 0; i < pass.length; i++)
    {
    char1 = pass.charAt(i);
    buf = (alpha.indexOf(char1));
    buf += 1;
    temp *= 26;
    temp += buf;
    }
    ----------------

    can anyone tell the value of pass (string) for which temp = 913216169672

    Plzz urgent

    also tel ,How to create the reverse code to get pass if possible
    Gopi -#The VBBOY#
    ~~~~~Google is God~~~~~~~

  2. #2
    Fanatic Member MetalKid's Avatar
    Join Date
    Aug 2005
    Location
    Green Bay, Wisconsin
    Posts
    534

    Re: What should be value of pass variable?

    I don't think anyone would be able to figure out exactly what word produced that number, but it would be easy to brute force it since multiple input strings could end up resolving to the same number.
    If your problem is solved, please use the Mark Thread As Resolved under Thread Tools!

    Show Appreciation. Rate Posts!

  3. #3
    Fanatic Member MetalKid's Avatar
    Join Date
    Aug 2005
    Location
    Green Bay, Wisconsin
    Posts
    534

    Re: What should be value of pass variable?

    The password was:

    direction

    Code:
               string alpha = "abcdefghijklmnopqrstuvwxyz";
                long num = 913216169672;
                string password = string.Empty;
                while (num > 0)
                {
                    long rem = num % 26;  //mod
                    password = (alpha[(int)rem - 1]) + password;
                    num = (num - rem) / 26;
                }
    If your problem is solved, please use the Mark Thread As Resolved under Thread Tools!

    Show Appreciation. Rate Posts!

Posting Permissions

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



Click Here to Expand Forum to Full Width