How to convert a byte array into a hexadecimal string

Posted on 2008-11-12
Last Modified: 2012-05-05
I am programming an NFC smart card reader and am having trouble getting the hexadecimal version of the byte array the device is sending back to me.

I put in FF00000004D44A0100, which is in hex form but the NFC reader spits is back to me in decimal form which makes it hard to look at the list of responses that the API lists. Is there any quick and easy way to convert this array into the hexidecimal equivalent and have it as string? Thanks!

 'Send Polling Command, Checks to see if
Reader0.Transmit(SCUtil.ToByteArray("FF00000004D44A0100"), resByte)
Reader1.Transmit(SCUtil.ToByteArray("FF00000004D44A0100"), resByte)
Reader2.Transmit(SCUtil.ToByteArray("FF00000004D44A0100"), resByte)
Reader3.Transmit(SCUtil.ToByteArray("FF00000004D44A0100"), resByte)

'Returns one of two values
 'Tag Found (0) = 97 (1) = 17 in hex = 0x610E
 'Tag Not Found (0) = 97 (1) = 5 in hex =0x6105

 If (SCUtil.FromByteArray(resByte)) Then

                Reader0.Transmit(SCUtil.ToByteArray("FFC000000E"), resByte)

                'Got Tag ID, now based on reader and tag, do something
 End If
Question by:ckehoe
    LVL 7

    Accepted Solution

    LVL 1

    Author Comment

    ah perfect! Thanks!

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now