Sub AppStart (Args() As String)
Log(HexToLong("FF"))
Log(HexToLong("FFFFFFFFFF"))
End Sub
Sub HexToLong(hex As String) As Long
Dim bc As ByteConverter
If hex.Length > 16 Then
hex = hex.SubString2(0, 16)
Else
Dim sb As StringBuilder
sb.Initialize
sb.Append(hex)
Do While sb.Length < 16
sb.Insert(0, "0")
Loop
hex = sb.ToString
End If
Dim data() As Byte = bc.HexToBytes(hex)
Return bc.LongsFromBytes(data)(0)
End Sub