Forum › MIFARE general topics and applications › Mifare 1K to HEX › Reply To: Mifare 1K to HEX
Hi Mike,
You can use this function to get byte array, after that, you can convert byte array to the string hex value:
You can use this function to get byte array, after that, you can convert byte array to the string hex value:
public static byte[] toByteArray(int data, int length){
byte[] byteArr = ByteBuffer.allocate(INT_LENGTH).putInt(data).array();
if(length!=INT_LENGTH)
byteArr = Arrays.copyOfRange(byteArr, INT_LENGTH - length, INT_LENGTH);
return byteArr;
}
+ 0
|
- 0