Преобразовать длинный Hex (8 байт) в Decimal и обратно
Код (vb.net):
Function HexToDec(strHex)
Dim i
Dim size
Dim ret
size = Len(strHex) - 1
ret = CDbl(0)
For i = 0 To size
ret = ret + CDbl("&H" & Mid(strHex, size - i + 1, 1)) * (CDbl(16) ^ CDbl(i))
Next
HexToDec = ret
End Function
Function DecToHex(dblNumber)
Dim Q
Dim ret
ret = ""
Q = CDbl(Fix(dblNumber))
While Q > 0
ret = Hex(Q - Fix(Q / 16) * 16) & ret
Q = Fix(Q / CDbl(16))
Wend
DecToHex = ret
End Function