Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HASHing function in PERL

Status
Not open for further replies.

vamsinadella

Programmer
Joined
Mar 29, 2007
Messages
1
Location
US
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
 
Performing the hashing is the easy part: have a look at the Digest::MD5 and Digest::SHA1 modules.

Your requirements about how other programs are supposed to access this script are not very clear. Does it have to be web-accessible or was that something you've added? The simplest way would be to have a command line script that takes in some data, hashes it and prints the output. Any program running on the same machine would be able to run it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top