Advertisement
B1KMusic

Base-32 explanation / Manual conversion

Jan 18th, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. H e l l o
  2. 48 65 6C 6C 6F
  3.  
  4. 48 - 0100 1000
  5. 65 - 0110 0101
  6. 6C - 0110 1100
  7. 6C - 0110 1100
  8. 6F - 0110 1111
  9.  
  10. So we get 0100100001100101011011000110110001101111, which is 40 bits long. Num of 0's to pad to left = 40 % 5 = 0
  11.  
  12. Base32 Table:
  13. 0 00000 0
  14. 1 00001 1
  15. 2 00010 2
  16. 3 00011 3
  17. 4 00100 4
  18. 5 00101 5
  19. 6 00110 6
  20. 7 00111 7
  21. 8 01000 8
  22. 9 01001 9
  23. 10 01010 A
  24. 11 01011 B
  25. 12 01100 C
  26. 13 01101 D
  27. 14 01110 E
  28. 15 01111 F
  29. 16 10000 G
  30. 17 10001 H
  31. 18 10010 I
  32. 19 10011 J
  33. 20 10100 K
  34. 21 10101 L
  35. 22 10110 M
  36. 23 10111 N
  37. 24 11000 O
  38. 25 11001 P
  39. 26 11010 Q
  40. 27 11011 R
  41. 28 11100 S
  42. 29 11101 T
  43. 30 11110 U
  44. 31 11111 V
  45.  
  46. 01001 - 9 - 9 - 9
  47. 00001 - 1 - 1 - 1
  48. 10010 - 9*2 - 18 - I
  49. 10110 - 9*2+4 - 22 - M
  50. 11000 - 6*4 - 24 - O
  51. 11011 - 6*4+3 - 27 - R
  52. 00011 - 3 - 3 - 3
  53. 01111 - 15 - 15 - F
  54.  
  55. 91IMOR3F
  56.  
  57. This is how to manually encode/decode a string.
  58.  
  59. To decode a string, convert each base 32 character back into their respective 5-bit groups, count the number of bits n, n % 4 = number of 0's to remove from left of string. Then convert that binary string back into ASCII.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement