hi all,
I'm in develop system via Card Reader....and on thing I'm found problem is...
The HEX data that apper is twisted with my old application..
It's like this;-
0A 37 73 AF supposely be like this AF 73 37 0A
Can anyone help me? plz...:'(
hi all,
I'm in develop system via Card Reader....and on thing I'm found problem is...
The HEX data that apper is twisted with my old application..
It's like this;-
0A 37 73 AF supposely be like this AF 73 37 0A
Can anyone help me? plz...:'(
Most likely this is a byte-order (endianness) mismatch between what the card reader sends and how your app or database expects the serial. described the output appearing "reversed" and 's question about what to do with the hex is exactly the right place to start: confirm whether the device is sending bytes LSB-first or MSB-first and normalize before comparison. See a short explanation of endianness here.
Practical steps:
Example (WinForms/C#) to reverse byte order read from a TextBox:
string hex = textBox1.Text.Replace(" ", "");
int n = hex.Length;
byte[] bytes = new byte[n / 2];
for (int i = 0; i < bytes.Length; i++)
bytes[i] = Convert.ToByte(hex.Substring(i * 2, 2), 16);
Array.Reverse(bytes);
textBox1.Text = BitConverter.ToString(bytes).Replace("-", " "); Notes and troubleshooting: check the reader manual/SDK for settings that control byte order or CRC inclusion. If reversing bytes doesn't match, verify whether bits or nibbles are being reversed (less common). Always store and compare a single canonical format in the DB so future readers or changes are easier to handle; use the device docs and Array.Reverse if you need to perform the transformation in code.
Jump to Post— DangerDev 107what you want to do with hex data ?
what you want to do with hex data ?
To compare with my database data..actually for serial ID .....i'm use serial id number as special key for link to Staff infomation...it's like A325E90 for Staf ID - 0223,Name :John.....so i use this hex data for reconise the userr....plz help me
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.