• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1409
  • Last Modified:

How to convert a byte array into a hexadecimal string

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
1 Solution
ckehoeAuthor Commented:
ah perfect! Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now