dimanche 1 mars 2015

How convert Hex String into Byte Array in VB6

I have the following byte array.



Dim Template(1023) As Byte


Then i call the fingerprint scanner device function and returns the following:



Template(0) = 70
Template(1) = 77
Template(2) = 82
...
Template(1023) = 0


Then i convert the Bytes array into a string hex as follows (view attached image):



Dim n As Long, i As Long
ByteArrayToHexStr = Space$(3 * (UBound(Template) - LBound(Template)) + 2)
n = 1
For i = LBound(Template) To UBound(Template)
Mid$(ByteArrayToHexStr, n, 2) = Right$("00" & Hex$(b(i)), 2)
n = n + 3
Next


Byte Array converted into Hex String How can i convert the hex string into a byte array again?


Thanks!!


Aucun commentaire:

Enregistrer un commentaire