Forum › MIFARE general topics and applications › Mifare 1K to HEX › Reply To: Mifare 1K to HEX
Hi Mike,
How you getting this id?
If command is correct, you should get the array of bytes. If you can get String text from that byte array you can use following code:
Java
How you getting this id?
If command is correct, you should get the array of bytes. If you can get String text from that byte array you can use following code:
Java
public static String toHexString(byte[] buffer) {
String bufferString = "";
for (int i = 0; i < buffer.length; i++) {
String hexChar = Integer.toHexString(buffer & 0xFF);
if (hexChar.length() == 1) {
hexChar = "0" + hexChar;
}
bufferString += hexChar.toUpperCase() + " ";
}
bufferString = bufferString.substring(0, bufferString.length()-1);
return bufferString;
}
+ 0
|
- 0