Hashing Function in PERL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vamsinadella
    New Member
    • Mar 2007
    • 3

    Hashing Function in PERL

    Hi all,

    I have to write a simple script (PHP or Perl) which takes in certain parameters, appends them and hashes them using SHA or SHA1 (or even MD5 is also ok) and spits out the hashed value. But the catch is, this script (may be sitting on a web server or something) has to be accessible by any application desired. some xyz app say written in .net or php or VB or any abc s/w should be able to access this script and get the hashed value. I'm fairly New to Perl and have a lot of questions:
    First of all, How do I write the script to accomplish this feature?

    What is this script? Meaning, is this a function or what is this? and if it is a function, is it stand alone? Can we just have stand alone scripts sitting on server? Will that work? If not, how to make it work?

    Where should I put this script on the web server so that everyone can access this.

    How can any app access this? I mean, the method. Do they call this function from their app or what do they have to do?

    I know there are too many questions but i never ever wrote a perl script in my life. This si the first. i'm reading some tutorials and getting along, but these are such details that never appear on any tutorials. So any help is greatly appreciated. Thanks you all a lot.

    - Vamsi
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    How is it you have to do something for which you apparently have no education, training or experience? What type of programing experience do you have?

    Comment

    • vamsinadella
      New Member
      • Mar 2007
      • 3

      #3
      Originally posted by KevinADC
      How is it you have to do something for which you apparently have no education, training or experience? What type of programing experience do you have?
      I'm a database guy Kevin. I will have to do this because i was asked to do this. Is it that difficult which made you ask this question??

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        Well, I don't know, but you said:


        I never ever wrote a perl script in my life.

        So for you I would say it's going to be impossible at this point. Whats the time frame you have to get this done?

        Comment

        • vamsinadella
          New Member
          • Mar 2007
          • 3

          #5
          Originally posted by KevinADC
          Well, I don't know, but you said:





          So for you I would say it's going to be impossible at this point. Whats the time frame you have to get this done?
          By Tomorrow morning. Atleast can you get me started? It's not that i'm completely new to programming. I know some php, vb, c# etc..but perl --first time. If you could show methe way then i'll fight it out and see what i can do. Thanks.

          Comment

          • KevinADC
            Recognized Expert Specialist
            • Jan 2007
            • 4092

            #6
            First of all, How do I write the script to accomplish this feature?

            To write perl scripts, use any text editor that saves them in plain text format (ASCII).

            What is this script? Meaning, is this a function or what is this? and if it is a function, is it stand alone? Can we just have stand alone scripts sitting on server? Will that work? If not, how to make it work?

            It's a script, how you use it or call it or whatever depends on whats calling it, what it does, etc etc etc.

            Where should I put this script on the web server so that everyone can access this.

            If you mean for internet use, normally that would be the cgi-bin but it could any folder. Then you access the script via CGI forms or query string requests.

            How can any app access this? I mean, the method. Do they call this function from their app or what do they have to do?

            Apps access it using whatever functions or interface they have to run external programs. Command line interface could be like:

            perl nameofscript.pl <list of arguments to pass to script>

            Comment

            • KevinADC
              Recognized Expert Specialist
              • Jan 2007
              • 4092

              #7
              How'd it go? Did you get it done?

              Comment

              Working...