Advertisement
GegoXaren

BASE32(HEX) reverse tabels.

Apr 10th, 2021 (edited)
1,040
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.52 KB | None | 0 0
  1. #if 0
  2.   LEGEND:
  3. 0..127     VALID NUMBER.
  4.  
  5. -1         INVALID
  6.  
  7. -2         IGNORE
  8.  
  9. -3         PADDING MARK
  10. #endif
  11.  
  12. UNUSED
  13. static const t_int8
  14. BASE_32_REVERSE[128] = {
  15. /* 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F     */
  16.   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*0*/
  17.   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*1*/
  18.   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*2*/
  19.   -1, -1, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -3, -1, -1, /*3*/
  20.   -1,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, /*4*/
  21.   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, /*5*/
  22.   -1,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, /*6*/
  23.   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, /*7*/
  24. };
  25.  
  26. UNUSED
  27. static const t_int8
  28. BASE_32_HEX_REVERSE[128] = {
  29. /* 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F     */
  30.   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*0*/
  31.   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*1*/
  32.   -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*2*/
  33.    0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, /*3*/
  34.   -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, /*4*/
  35.   25, 26, 27, 28, 29, 30, 31, 31, -1, -1, -1, -1, -1, -1, -1, -1, /*5*/
  36.   -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, /*7*/
  37.   25, 26, 27, 28, 29, 30, 31, 31, -1, -1, -1, -1, -1, -1, -1, -1, /*8*/
  38. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement