jana
asked on
How to produce a SHA-1 hash function in vb6 in order to save it to a table
Please help us for a code in vb6 to hash SHA-1 a string before I saving to a table.
Thank you in advance
Thank you in advance
ASKER
Yes, that's what we need, one-way. We hash sha1 the result save it to table.
Can this be done in vb6?
Can this be done in vb6?
Ok, take a look at this link. It has source code that purports to do what you want.
http://vb.wikia.com/wiki/SHA-1.bas
http://vb.wikia.com/wiki/SHA-1.bas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx!!! Found a code thet works excellent and we compared it to MS SQL HASHBYTE function is almost the exact!
We say exact because the SQL function always returns "0x" when the vb code doesn't.
For example the has for 'experts-exchange' in
vb6 code is: 9022fc0e1985bb7c0ac60792ee 3fbe3029af 0424
in SQL is: 0x9022FC0E1985BB7C0AC60792 EE3FBE3029 AF0424
notice "0x"
We extract the "0x" from SQL statement result and both SQL & VB results are the same.
Is there a reason for the "0x" and should we be concerned?
We say exact because the SQL function always returns "0x" when the vb code doesn't.
For example the has for 'experts-exchange' in
vb6 code is: 9022fc0e1985bb7c0ac60792ee
in SQL is: 0x9022FC0E1985BB7C0AC60792
notice "0x"
We extract the "0x" from SQL statement result and both SQL & VB results are the same.
Is there a reason for the "0x" and should we be concerned?
yes, that is not actually a part of the hash. It is there to signify that the remaining characters are hexidecimal. It is safe to just strip it off as you did.
ASKER
Thanx!!! You really helped us!!
You're welcome.
https://support.microsoft.com/en-us/kb/821762