Home > Software engineering >  From the MYSQL database to a 32-bit hexadecimal how user name in VB converted into corresponding Chi
From the MYSQL database to a 32-bit hexadecimal how user name in VB converted into corresponding Chi

Time:10-03

On the Internet to find a lot of methods like transformation are not

Of 246871239068 af8203154b76a26f7cd9 user called 32-bit hexadecimal conversion as the normal user name should be Chinese characters

Thank you want to provide the appropriate code

Also said this code conversion out of garbage characters don't know what the reason may be encoded in a different way,
The Function HexToStr (x)
For I=1 to Len (x) Step 4
HexToStr=HexToStr & amp; Chrw (" & amp; H "& amp; Mid (X, I, 4))
Next
End the Function

CodePudding user response:

How do you sure can convert,
How user name happens to be 32 bit?
Say you only have one code, at least you want to give some more, and their corresponding user name is what just good judgment,

CodePudding user response:

Most of the encrypted,

CodePudding user response:

Each user names are 32-bit not likely is encrypted by chance

CodePudding user response:

246871239068 af8203154b76a26f7cd9 called 32-bit? Should be 16 bytes, or 128,

CodePudding user response:

Is likely to be encrypted

CodePudding user response:

Try this line not line
 
The Public Function StrToHex (ByVal s As String) As String
On the Error Resume Next
Dim ByteArr () As Byte
Dim Temps As String
Dim As Long I
ByteArr=StrConv (s, vbFromUnicode)
For I=0 To UBound (ByteArr)
Temps=Hex (ByteArr (I))
Temps=right (" 00 "& amp; Temps, 2)
StrToHex=StrToHex & amp; Temps
Next
End the Function


The Public Function HexToStr (ByVal HexStr As String) As String
Dim vArr () As Byte, I As Long
Dim vLen As Long
VLen=Len (HexStr) \ 2
ReDim vArr (vLen - 1)

For I=0 To vLen - 1
VArr (I)=Val (" & amp; H "& amp; Mid $(HexStr, I * 2 + 1, 2))
Next

HexToStr=StrConv (vArr vbUnicode)

End the Function
  • Related