The following code converts hex string
to numeric
values and it works fine with small hex numbers such as 1f
. But, it doesn't work with large numbers such as "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717"
because the int32 can't have that much larger/small number. But there should be another way of bypassing these limits right? can someone shed some light here, or any search keywords are welcome to search through google etc as I couldn't find any methods to convert large hex numbers.
Public Class Form1
Dim data As String = "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717"
Dim result1 As String = Nothing
Public Function hexToNumeric(ByVal inputHexstring As String)
Dim val As Integer
val = Convert.ToInt32(inputHexstring, 16)
Return val
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
result1 = hexToNumeric(data)
End Sub
End Class