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

  

  1. $ cat ascii.sh
  2. dec_count=32
  3.  
  4. while [ $dec_count -lt 128 ]
  5. do
  6. times=0
  7. while [ $times -lt 16 ]
  8. do
  9. echo -e "\x$(echo "ibase=10;obase=16;$dec_count" | bc)\c"
  10. times=$((times+1))
  11. done
  12. dec_count=$((dec_count+1))
  13. done
  14.  
  15. $ bash ascii.sh | hexdump -C | cut -c57-60,64 > ascii_table
  16.  
  17. $ cat ascii_table
  18. 20
  19. 21 !
  20. 22 "
  21. 23 #
  22. 24 $
  23. 25 %
  24. 26 &
  25. 27 '
  26. 28 (
  27. 29 )
  28. 2a *
  29. 2b +
  30. 2c ,
  31. 2d -
  32. 2e .
  33. 2f /
  34. 30 0
  35. 31 1
  36. 32 2
  37. 33 3
  38. 34 4
  39. 35 5
  40. 36 6
  41. 37 7
  42. 38 8
  43. 39 9
  44. 3a :
  45. 3b ;
  46. 3c <
  47. 3d =
  48. 3e >
  49. 3f ?
  50. 40 @
  51. 41 A
  52. 42 B
  53. 43 C
  54. 44 D
  55. 45 E
  56. 46 F
  57. 47 G
  58. 48 H
  59. 49 I
  60. 4a J
  61. 4b K
  62. 4c L
  63. 4d M
  64. 4e N
  65. 4f O
  66. 50 P
  67. 51 Q
  68. 52 R
  69. 53 S
  70. 54 T
  71. 55 U
  72. 56 V
  73. 57 W
  74. 58 X
  75. 59 Y
  76. 5a Z
  77. 5b [
  78. 5c \
  79. 5d ]
  80. 5e ^
  81. 5f _
  82. 60 `
  83. 61 a
  84. 62 b
  85. 63 c
  86. 64 d
  87. 65 e
  88. 66 f
  89. 67 g
  90. 68 h
  91. 69 i
  92. 6a j
  93. 6b k
  94. 6c l
  95. 6d m
  96. 6e n
  97. 6f o
  98. 70 p
  99. 71 q
  100. 72 r
  101. 73 s
  102. 74 t
  103. 75 u
  104. 76 v
  105. 77 w
  106. 78 x
  107. 79 y
  108. 7a z
  109. 7b {
  110. 7c |
  111. 7d }
  112. 7e ~
  113. 7f .
  114.  
  115. [daniel@win-8me2aq586jt Creates message box.53BA45E9]$

  

  1. Prelude> zip [0x1..0x7f] ['\x01'..'\x7f']
  2. [(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')]

  

  1. daniel@daniel-mint ~/haskell $ cat trizip.hs
  2. import Text.Printf
  3. import Numeric
  4.  
  5. trizip :: [a] -> [b] -> [c] -> [(a,b,c)]
  6. trizip a b c
  7. | null a = []
  8. | null b = []
  9. | null c = []
  10. trizip (x:xs) (y:ys) (z:zs) = (++) [(x,y,z)] (trizip xs ys zs)
  11.  
  12. showtuple :: (Int, Char, Int) -> String
  13. showtuple (di, ch, hi) = (show di) ++ "\t0x" ++ (showHex hi "\t") ++ (show ch) ++ "\n"
  14.  
  15. main = do
  16. let asciit = trizip [0x1..0x7f] ['\x01'..'\x7f'] [0x1..0x7f]
  17. putStr (concat (map showtuple asciit))

  

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

  

generate ascii table的更多相关文章

  1. ASCII Table

    ASCII Table ASCII值 控制字符 ASCII值 控制字符 ASCII值 控制字符 ASCII值 控制字符 0 NUT 32 (space) 64 @ 96 . 1 SOH 33 ! 65 ...

  2. ASCII Table/ASCII表

    ASCII Table/ASCII表 参考: 1.Table of ASCII Characters

  3. SQL Server ->> Move characters in string N position(s) forward/backward based on ASCII table(根据ASCII表的排列顺序将字符串内的数值往前或者后移N个位)

    去年无聊的时候想到想玩一下根据ASCII表的排列顺序将字符串内的数值往前或者后移N个位,顺便看一下是T-SQL性能好还是用C#写CLR函数处理得快.结果是在50万行以下其实两者差距很小,当然这是在我的 ...

  4. ASCII Table - ASCII码对照表

    ASCII控制字符 二进制 十进制 十六进制 缩写 可以显示的表示法 名称/意义 0000 0000 0 00 NUL ␀ 空字符(Null) 0000 0001 1 01 SOH ␁ 标题开始 00 ...

  5. Ascii vs. Binary Files

    Ascii vs. Binary Files Introduction Most people classify files in two categories: binary files and A ...

  6. Binary to Text (ASCII) Conversion

    Binary to Text (ASCII) Conversion Description: Write a function that takes in a binary string and re ...

  7. ASCII 码对应表

    Macron symbol ASCII CODE 238 : HTML entity : [ Home ][ español ] What is my IP address ? your public ...

  8. DAX/PowerBI系列 - 关于时间系列 - 如何用脚本生成时间维度 (Generate Date Dimension)

    跟大家的交流是我的动力. :) DAX/PowerBI系列 - 关于时间系列 - 如何用脚本生成时间维度 (Generate Date Dimension) 难度: ★☆☆☆☆(1星) 适用范围: ★ ...

  9. (SpringBoot-Jpa)使用Idea数据库自动脚本Generate POJOS生成 Entity对象,

    因:使用SpringBoot -jpa,需要手动配置Entity 但是如果你的表中有很多属性,或者有很多表怎么办?? 每个手动写? 还是用mybatis.写mapper??? 解决:使用idea自动工 ...

随机推荐

  1. Redis详细用法

    Redis详细用法 1.redis启动命令 本机Redis 安装路径是在usr/local/redis 目录下 启动命令: ./redis-server redis.conf(启动时指定配置文件) 测 ...

  2. Java学习之线程通信(多线程(synchronized))--生产者消费者

    分析线程经典案例生产者消费者 /** 共享数据 */ class Resource { private String name; private int count=1; private boolea ...

  3. luoguP3258 [JLOI2014]松鼠的新家 题解(树上差分)

    P3258 [JLOI2014]松鼠的新家  题目 树上差分:树上差分总结 #include<iostream> #include<cstdlib> #include<c ...

  4. docker--build自己的image

    通过container commit成image [root@localhost docker_test]# docker container commit #可以简写成docker commit a ...

  5. 62.Longest Valid Parentheses(最长的有效括号)

    Level:   Medium 题目描述: Given a string containing just the characters '(' and ')', find the length of ...

  6. 封装一个Js 对象 生成Json

    <script src="~/Content/Scripts/jquery-1.11.3.min.js"></script> <script> ...

  7. Python之复数、分数、大型数组数学运算(complex、cmath、numpy、fractions)

    一.复数的数学运算 复数可以用使用函数 complex(real, imag) 或者是带有后缀j的浮点数来指定 a=complex(2,4) print(a) # (2+4j) b=2-5j # 获取 ...

  8. js不加alert后面的代码不工作

    问题:用Ajax从后台拿到了json,append到select的option里面,然后想用for循环来设置某个作为默认值,发现在for循环外面加了个alert()的话,就能实现成功,没有加这个ale ...

  9. 前端学习(二十三)DOM操作,事件(笔记)

    javascript 组成部分    1.ECMAScript        javascript的核心解释器 2.DOM        Document Object Modle         文 ...

  10. java while循环

    /* while 循环有一个标准格式,还有一个扩展格式 标准格式: while(条件表达式){ 循环体 } 扩展格式: 初始化语句; while(条件判断){ 循环体 步进表达式 } */ publi ...