Soumen-Roy
asked on
VB.Net to VB6 Conversion
Hi Experts,
Can anybody convert the following code to VB6?
Private Function SHA512String(ByVal input As String) As String
Dim data() As Byte = System.Text.Encoding.ASCII .GetBytes( input)
Dim shaM As New SHA512Managed()
Dim result() As Byte = shaM.ComputeHash(data)
Dim output As String = ""
For Each b As Byte In result
output += b.ToString("x2")
Next
Return output
End Function
Can anybody convert the following code to VB6?
Private Function SHA512String(ByVal input As String) As String
Dim data() As Byte = System.Text.Encoding.ASCII
Dim shaM As New SHA512Managed()
Dim result() As Byte = shaM.ComputeHash(data)
Dim output As String = ""
For Each b As Byte In result
output += b.ToString("x2")
Next
Return output
End Function
I'm not sure VB6 has a readily available SHA 512 library. You may need to implement your own.
I think it would be easier to create a component (.dll) in .Net with this code and use it from VB6.
ASKER
@emoreau
Is it not possible to do that in VB6?
I can make VB.Net dll from that code, say named a.dll. But I don't know how the dll can be called from VB6. Can you please help?
Regards,
Soumen
Is it not possible to do that in VB6?
I can make VB.Net dll from that code, say named a.dll. But I don't know how the dll can be called from VB6. Can you please help?
Regards,
Soumen
ASKER
@emoreau,
Thank you for the link, just one more little query, if I make the above function in VB.Net and compile it as dll, then call that dll from VB6 exe, will that VB6 exe need framework as it is calling .net dll or; framework will not needed as it is compiled as COM?
Please help,
Regards,
Soumen
Thank you for the link, just one more little query, if I make the above function in VB.Net and compile it as dll, then call that dll from VB6 exe, will that VB6 exe need framework as it is calling .net dll or; framework will not needed as it is compiled as COM?
Please help,
Regards,
Soumen
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 for the idea, I will try it, Thanx a lot