Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

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
0
Soumen-Roy
Asked:
Soumen-Roy
  • 3
  • 3
1 Solution
 
käµfm³d 👽Commented:
I'm not sure VB6 has a readily available SHA 512 library. You may need to implement your own.
0
 
Éric MoreauSenior .Net ConsultantCommented:
I think it would be easier to create a component (.dll) in .Net with this code and use it from VB6.
0
 
Soumen-RoyAuthor Commented:
@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
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Éric MoreauSenior .Net ConsultantCommented:
0
 
Soumen-RoyAuthor Commented:
@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
0
 
Éric MoreauSenior .Net ConsultantCommented:
you will need the .Net framework. the good thing is that it is installed on almost all PC now!
0
 
Soumen-RoyAuthor Commented:
Thanx for the idea, I will try it, Thanx a lot
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now