bin2hex shell linux
打印文件的十六进制数据用hexdump就可以了。也可以使用xxd.
示例:
hexdump -C certs/accert/ac.oer
00000000 80 03 00 83 08 c7 95 5d 5e b0 fb 26 29 50 80 00 |.......]^..&)P..|
00000010 00 51 55 74 42 7f 2b 52 98 fe 6c 71 44 ba 00 0a |.QUtB.+R..lqD...|
00000020 21 0b b1 40 84 00 a9 83 01 01 80 00 9c 01 02 00 |!..@............|
00000030 01 6f 00 01 70 80 84 21 83 52 53 01 bc c2 2f 17 |.o..p..!.RS.../.|
00000040 d9 10 60 5a 03 32 3a e9 d4 eb 72 d7 f5 c1 15 bd |..`Z.2:...r.....|
00000050 99 84 a2 c2 27 a9 21 8e c0 84 40 ba 8d b1 6c 92 |....'.!...@...l.|
00000060 c6 41 b4 24 44 0d be ae 2e d4 4f 22 47 af 1b c2 |.A.$D.....O"G...|
00000070 bb 58 8b a2 db e8 b5 c7 03 20 b5 aa 15 22 53 83 |.X....... ..."S.|
00000080 73 22 7c f2 13 68 c9 2b 1f b5 22 37 f5 2e 30 81 |s"|..h.+.."7..0.|
00000090 55 a0 74 b1 38 d8 8b e2 f7 f4 d7 |U.t.8......|
xxd -p -u certs/accert/ac.oer
8003008308C7955D5EB0FB262950800000515574427F2B5298FE6C7144BA
000A210BB1408400A983010180009C010200016F00017080842183525301
BCC22F17D910605A03323AE9D4EB72D7F5C115BD9984A2C227A9218EC084
40BA8DB16C92C641B424440DBEAE2ED44F2247AF1BC2BB588BA2DBE8B5C7
0320B5AA1522538373227CF21368C92B1FB52237F52E308155A074B138D8
8BE2F7F4D7
xxd -p -u -i certs/accert/ac.oer
unsigned char certs_accert_ac_oer[] = {
0X80, 0X03, 0X00, 0X83, 0X08, 0XC7, 0X95, 0X5D, 0X5E, 0XB0, 0XFB, 0X26,
0X29, 0X50, 0X80, 0X00, 0X00, 0X51, 0X55, 0X74, 0X42, 0X7F, 0X2B, 0X52,
0X98, 0XFE, 0X6C, 0X71, 0X44, 0XBA, 0X00, 0X0A, 0X21, 0X0B, 0XB1, 0X40,
0X84, 0X00, 0XA9, 0X83, 0X01, 0X01, 0X80, 0X00, 0X9C, 0X01, 0X02, 0X00,
0X01, 0X6F, 0X00, 0X01, 0X70, 0X80, 0X84, 0X21, 0X83, 0X52, 0X53, 0X01,
0XBC, 0XC2, 0X2F, 0X17, 0XD9, 0X10, 0X60, 0X5A, 0X03, 0X32, 0X3A, 0XE9,
0XD4, 0XEB, 0X72, 0XD7, 0XF5, 0XC1, 0X15, 0XBD, 0X99, 0X84, 0XA2, 0XC2,
0X27, 0XA9, 0X21, 0X8E, 0XC0, 0X84, 0X40, 0XBA, 0X8D, 0XB1, 0X6C, 0X92,
0XC6, 0X41, 0XB4, 0X24, 0X44, 0X0D, 0XBE, 0XAE, 0X2E, 0XD4, 0X4F, 0X22,
0X47, 0XAF, 0X1B, 0XC2, 0XBB, 0X58, 0X8B, 0XA2, 0XDB, 0XE8, 0XB5, 0XC7,
0X03, 0X20, 0XB5, 0XAA, 0X15, 0X22, 0X53, 0X83, 0X73, 0X22, 0X7C, 0XF2,
0X13, 0X68, 0XC9, 0X2B, 0X1F, 0XB5, 0X22, 0X37, 0XF5, 0X2E, 0X30, 0X81,
0X55, 0XA0, 0X74, 0XB1, 0X38, 0XD8, 0X8B, 0XE2, 0XF7, 0XF4, 0XD7
};
unsigned int certs_accert_ac_oer_len = 155;