canlasjp
asked on
Checksum Function in PL/SQL
Hi! Does anybody have a checksum function in PL/SQL (or algorithmn) that translates a string of text into a number ? I prefer to use Oracle's standard function if it is accessible. I am using this is for authentication purposes. Thanks.
I'm not sure about your question. What does checksum has to do with translating a string to number? If you just want to transform a string to its corresponding hex values, then you can use the functions available in sql to do that.
Can you be a bit more specific about what you're looking for, I can give you code to generate a CRC (not Oracle's own method) using the standard CRC algorithm or Fletcher's checksum, but I suspect that isn't what you want.
ASKER
Xiaodong/Answers2000, I am actually looking for a CRC routine or encryption routine written in PL/SQL. This function should take in a string as input parameter and return a number or encrypted text. If possible, the function should work on both ASCII and EBCDIC Oracle servers. Thanks.
One other way to acheive this.
I commit the same problem, what I did is, I created a record group in design time and inserted all values with flag at run time, and I handled that values after the successful processing of some function, so as to save sequence index number.
I commit the same problem, what I did is, I created a record group in design time and inserted all values with flag at run time, and I handled that values after the successful processing of some function, so as to save sequence index number.
ASKER
Kevin, the solution you proposed will not work for me. The function (probably server side function) should compute and return the CRC (cyclic redundancy check) number of a given character string.
Thanks anyway.
Thanks anyway.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Mujeeb. This is ok but I still need to test this in an EBCDIC machine. Can you just explain what the MR variable and its values are for ?
You are most welcome.
The MR variable is used to add extra calcutaion in the string so that one can not guess in an easy way by just adding the values one after another.
U can say it is just added salt to through someone out of the track who want to reproduce the calculated number by adding the values.
By the way MR stands for my name initials :) and the starting value if u notice is 155 which is 'r' and when it reaches 115 which again is 'M' it reset it to 155 again :) and it continues this way till whole string is calculated.
The MR variable is used to add extra calcutaion in the string so that one can not guess in an easy way by just adding the values one after another.
U can say it is just added salt to through someone out of the track who want to reproduce the calculated number by adding the values.
By the way MR stands for my name initials :) and the starting value if u notice is 155 which is 'r' and when it reaches 115 which again is 'M' it reset it to 155 again :) and it continues this way till whole string is calculated.