Excelpromax123
Board Regular
- Joined
- Sep 2, 2021
- Messages
- 165
- Office Version
- 2010
- Platform
- Windows
Hello everyone. I have used a function to convert a text to MD5 code. But win 10 has a number of machines that give empty results (Win 7 does not see it). Thanks for everyone's help with the code to fix it. Thank you
Code:
Code:
VBA Code:
Public Function md5convet(textString As String) As String
On Error Resume Next
Dim enc
Dim textBytes() As Byte
Dim bytes
Dim outstr As String
Set enc = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider")
textBytes = textString
bytes = enc.ComputeHash_2((textBytes))
For pos = 1 To LenB(bytes)
outstr = outstr & LCase(Right("0" & Hex(AscB(MidB(bytes, pos, 1))), 2))
Next
md5convet = outstr
Set enc = Nothing
End Function
Sub Test()
MsgBox (md5convet("abc"))
End Sub