Ubuntu Pastebin

Paste from Ben64 at Wed, 21 Oct 2015 14:11:41 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.lang.String;
import java.lang.Long;

// 1234567890(decimal) to 100100100101100000001011010010 to 1001000000000000000000000000010000000101101001000000001100101 to 1200000080B48065(hex)

public class NfcRaw {

 public static void
 main(String[] argv)
 {
  if (argv.length > 0) {
   long input = Long.parseLong(argv[0]);
   long nfc_data = 0;
   nfc_data |= (input & 0x0003FC0000000000L) >> 42 << 40;
   nfc_data |= (input & 0x000003FC00000000L) >> 34 << 48;
   nfc_data |= (input & 0x00000003FC000000L) >> 26 << 56;
   nfc_data |= (input & 0x0000000003FC0000L) >> 18 << 0;
   nfc_data |= (input & 0x000000000003FC00L) >> 10 << 8;
   nfc_data |= (input & 0x00000000000003FCL) >>  2 << 16;
   nfc_data |= (input & 0x0000000000000003L) >>  0 << 30;
   System.out.println(Long.toString(nfc_data, 16));
  } else {
    System.out.println("usage: decimal");
  }
 }
}
Download as text