Sub getIDinHex( in As Long ) As String
Dim bc As ByteConverter, out As String
Dim l(1) as Long
l(0) = in
Dim byteArray() As Byte = bc.LongsToBytes( l )
' Convert the byte array to a hexadecimal string
out = bc.HexFromBytes( byteArray )
out = "0x" & Regex.Replace( "^0+", out, "" )
Return out
End Sub ' getIDinHex()