博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
generate ascii table
阅读量:6610 次
发布时间:2019-06-24

本文共 5675 字,大约阅读时间需要 18 分钟。

$ cat ascii.sh dec_count=0while [ $dec_count -lt 256 ]do        echo -e "\x$(echo "ibase=10;obase=16;$dec_count" | bc)\c"        dec_count=$((dec_count+1))done$ bash ascii.sh | hexdump -C00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|00000080  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|00000090  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|000000a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|000000b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|000000c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|000000d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|000000e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|000000f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|00000100

  

$ cat ascii.sh dec_count=32while [ $dec_count -lt 128 ]do        times=0        while [ $times -lt 16 ]        do                echo -e "\x$(echo "ibase=10;obase=16;$dec_count" | bc)\c"                times=$((times+1))        done        dec_count=$((dec_count+1))done$ bash ascii.sh | hexdump -C | cut -c57-60,64 > ascii_table$ cat ascii_table 20   21  !22  "23  #24  $25  %26  &27  '28  (29  )2a  *2b  +2c  ,2d  -2e  .2f  /30  031  132  233  334  435  536  637  738  839  93a  :3b  ;3c  <3d  =3e  >3f  ?40  @41  A42  B43  C44  D45  E46  F47  G48  H49  I4a  J4b  K4c  L4d  M4e  N4f  O50  P51  Q52  R53  S54  T55  U56  V57  W58  X59  Y5a  Z5b  [5c  \5d  ]5e  ^5f  _60  `61  a62  b63  c64  d65  e66  f67  g68  h69  i6a  j6b  k6c  l6d  m6e  n6f  o70  p71  q72  r73  s74  t75  u76  v77  w78  x79  y7a  z7b  {7c  |7d  }7e  ~7f  .[daniel@win-8me2aq586jt Creates message box.53BA45E9]$

  

Prelude> zip [0x1..0x7f] ['\x01'..'\x7f'][(1,'\SOH'),(2,'\STX'),(3,'\ETX'),(4,'\EOT'),(5,'\ENQ'),(6,'\ACK'),(7,'\a'),(8,'\b'),(9,'\t'),(10,'\n'),(11,'\v'),(12,'\f'),(13,'\r'),(14,'\SO'),(15,'\SI'),(16,'\DLE'),(17,'\DC1'),(18,'\DC2'),(19,'\DC3'),(20,'\DC4'),(21,'\NAK'),(22,'\SYN'),(23,'\ETB'),(24,'\CAN'),(25,'\EM'),(26,'\SUB'),(27,'\ESC'),(28,'\FS'),(29,'\GS'),(30,'\RS'),(31,'\US'),(32,' '),(33,'!'),(34,'"'),(35,'#'),(36,'$'),(37,'%'),(38,'&'),(39,'\''),(40,'('),(41,')'),(42,'*'),(43,'+'),(44,','),(45,'-'),(46,'.'),(47,'/'),(48,'0'),(49,'1'),(50,'2'),(51,'3'),(52,'4'),(53,'5'),(54,'6'),(55,'7'),(56,'8'),(57,'9'),(58,':'),(59,';'),(60,'<'),(61,'='),(62,'>'),(63,'?'),(64,'@'),(65,'A'),(66,'B'),(67,'C'),(68,'D'),(69,'E'),(70,'F'),(71,'G'),(72,'H'),(73,'I'),(74,'J'),(75,'K'),(76,'L'),(77,'M'),(78,'N'),(79,'O'),(80,'P'),(81,'Q'),(82,'R'),(83,'S'),(84,'T'),(85,'U'),(86,'V'),(87,'W'),(88,'X'),(89,'Y'),(90,'Z'),(91,'['),(92,'\\'),(93,']'),(94,'^'),(95,'_'),(96,'`'),(97,'a'),(98,'b'),(99,'c'),(100,'d'),(101,'e'),(102,'f'),(103,'g'),(104,'h'),(105,'i'),(106,'j'),(107,'k'),(108,'l'),(109,'m'),(110,'n'),(111,'o'),(112,'p'),(113,'q'),(114,'r'),(115,'s'),(116,'t'),(117,'u'),(118,'v'),(119,'w'),(120,'x'),(121,'y'),(122,'z'),(123,'{'),(124,'|'),(125,'}'),(126,'~'),(127,'\DEL')]

  

daniel@daniel-mint ~/haskell $ cat trizip.hsimport Text.Printfimport Numerictrizip :: [a] -> [b] -> [c] -> [(a,b,c)]trizip a b c	| null a = []	| null b = []	| null c = []trizip (x:xs) (y:ys) (z:zs) = (++) [(x,y,z)] (trizip xs ys zs)showtuple :: (Int, Char, Int) -> Stringshowtuple (di, ch, hi) = (show di) ++ "\t0x" ++ (showHex hi "\t") ++ (show ch) ++ "\n"main = do	let asciit =  trizip [0x1..0x7f] ['\x01'..'\x7f'] [0x1..0x7f]	putStr (concat (map showtuple asciit))

  

daniel@daniel-mint ~/haskell $ runhaskell trizip.hs1	0x1	'\SOH'2	0x2	'\STX'3	0x3	'\ETX'4	0x4	'\EOT'5	0x5	'\ENQ'6	0x6	'\ACK'7	0x7	'\a'8	0x8	'\b'9	0x9	'\t'10	0xa	'\n'11	0xb	'\v'12	0xc	'\f'13	0xd	'\r'14	0xe	'\SO'15	0xf	'\SI'16	0x10	'\DLE'17	0x11	'\DC1'18	0x12	'\DC2'19	0x13	'\DC3'20	0x14	'\DC4'21	0x15	'\NAK'22	0x16	'\SYN'23	0x17	'\ETB'24	0x18	'\CAN'25	0x19	'\EM'26	0x1a	'\SUB'27	0x1b	'\ESC'28	0x1c	'\FS'29	0x1d	'\GS'30	0x1e	'\RS'31	0x1f	'\US'32	0x20	' '33	0x21	'!'34	0x22	'"'35	0x23	'#'36	0x24	'$'37	0x25	'%'38	0x26	'&'39	0x27	'\''40	0x28	'('41	0x29	')'42	0x2a	'*'43	0x2b	'+'44	0x2c	','45	0x2d	'-'46	0x2e	'.'47	0x2f	'/'48	0x30	'0'49	0x31	'1'50	0x32	'2'51	0x33	'3'52	0x34	'4'53	0x35	'5'54	0x36	'6'55	0x37	'7'56	0x38	'8'57	0x39	'9'58	0x3a	':'59	0x3b	';'60	0x3c	'<'61	0x3d	'='62	0x3e	'>'63	0x3f	'?'64	0x40	'@'65	0x41	'A'66	0x42	'B'67	0x43	'C'68	0x44	'D'69	0x45	'E'70	0x46	'F'71	0x47	'G'72	0x48	'H'73	0x49	'I'74	0x4a	'J'75	0x4b	'K'76	0x4c	'L'77	0x4d	'M'78	0x4e	'N'79	0x4f	'O'80	0x50	'P'81	0x51	'Q'82	0x52	'R'83	0x53	'S'84	0x54	'T'85	0x55	'U'86	0x56	'V'87	0x57	'W'88	0x58	'X'89	0x59	'Y'90	0x5a	'Z'91	0x5b	'['92	0x5c	'\\'93	0x5d	']'94	0x5e	'^'95	0x5f	'_'96	0x60	'`'97	0x61	'a'98	0x62	'b'99	0x63	'c'100	0x64	'd'101	0x65	'e'102	0x66	'f'103	0x67	'g'104	0x68	'h'105	0x69	'i'106	0x6a	'j'107	0x6b	'k'108	0x6c	'l'109	0x6d	'm'110	0x6e	'n'111	0x6f	'o'112	0x70	'p'113	0x71	'q'114	0x72	'r'115	0x73	's'116	0x74	't'117	0x75	'u'118	0x76	'v'119	0x77	'w'120	0x78	'x'121	0x79	'y'122	0x7a	'z'123	0x7b	'{'124	0x7c	'|'125	0x7d	'}'126	0x7e	'~'127	0x7f	'\DEL'

  

转载于:https://www.cnblogs.com/long123king/p/3833092.html

你可能感兴趣的文章
《Linux就该这么学》 - 必读的红帽系统与红帽linux认证自学手册
查看>>
SNS网站的用户流失率怎么会高得如此惊人?
查看>>
敏捷个人应用:开发环境搭建
查看>>
Android应用程序组件Content Provider的共享数据更新通知机制分析(3)
查看>>
敏友的【敏捷个人】有感(11): 敏捷个人线下活动有感
查看>>
演示:为思科25/26系列的路由器升级IOS镜像
查看>>
2014年5月软考用书推荐&3年真题精解与闯关密卷创新点
查看>>
老男孩旗下项目实施套装服务
查看>>
【VMCloud云平台】SCCM(八)OSD(二)- 模板机捕获准备
查看>>
Docker容器固定IP分配
查看>>
刺激用户危机意识,实现快速盈利的营销思维
查看>>
虚拟化系列-Citrix XenServer 6.1 网络管理
查看>>
一个电脑做Wifi热点的软件——Connectify
查看>>
英特尔嵌入式突围
查看>>
发牌程序
查看>>
android 使用style修饰内容
查看>>
WIN FORM 多线程更新UI(界面控件)
查看>>
Hibernate简介
查看>>
如何从源码包安装软件?
查看>>
客户端检测 ( 9 章 ) (目前 略)
查看>>