document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. \'\'\' http://tizzyt-archive.blogspot.com/2014/02/saving-bandwidth-while-chatting-using.html
  2. Public Class TZ_Encoding
  3.     Private Shared LtrNbr As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"
  4.     Private Shared HexTable6 As Byte(,) =
  5.         {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0},
  6.          {0, 0, 0, 0, 1, 1}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 1, 0, 1},
  7.          {0, 0, 0, 1, 1, 0}, {0, 0, 0, 1, 1, 1}, {0, 0, 1, 0, 0, 0},
  8.          {0, 0, 1, 0, 0, 1}, {0, 0, 1, 0, 1, 0}, {0, 0, 1, 0, 1, 1},
  9.          {0, 0, 1, 1, 0, 0}, {0, 0, 1, 1, 0, 1}, {0, 0, 1, 1, 1, 0},
  10.          {0, 0, 1, 1, 1, 1}, {0, 1, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 1},
  11.          {0, 1, 0, 0, 1, 0}, {0, 1, 0, 0, 1, 1}, {0, 1, 0, 1, 0, 0},
  12.          {0, 1, 0, 1, 0, 1}, {0, 1, 0, 1, 1, 0}, {0, 1, 0, 1, 1, 1},
  13.          {0, 1, 1, 0, 0, 0}, {0, 1, 1, 0, 0, 1}, {0, 1, 1, 0, 1, 0},
  14.          {0, 1, 1, 0, 1, 1}, {0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 0, 1},
  15.          {0, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 0, 0},
  16.          {1, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 1, 0}, {1, 0, 0, 0, 1, 1},
  17.          {1, 0, 0, 1, 0, 0}, {1, 0, 0, 1, 0, 1}, {1, 0, 0, 1, 1, 0},
  18.          {1, 0, 0, 1, 1, 1}, {1, 0, 1, 0, 0, 0}, {1, 0, 1, 0, 0, 1},
  19.          {1, 0, 1, 0, 1, 0}, {1, 0, 1, 0, 1, 1}, {1, 0, 1, 1, 0, 0},
  20.          {1, 0, 1, 1, 0, 1}, {1, 0, 1, 1, 1, 0}, {1, 0, 1, 1, 1, 1},
  21.          {1, 1, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 1}, {1, 1, 0, 0, 1, 0},
  22.          {1, 1, 0, 0, 1, 1}, {1, 1, 0, 1, 0, 0}, {1, 1, 0, 1, 0, 1},
  23.          {1, 1, 0, 1, 1, 0}, {1, 1, 0, 1, 1, 1}, {1, 1, 1, 0, 0, 0},
  24.          {1, 1, 1, 0, 0, 1}, {1, 1, 1, 0, 1, 0}, {1, 1, 1, 0, 1, 1},
  25.          {1, 1, 1, 1, 0, 0}, {1, 1, 1, 1, 0, 1}, {1, 1, 1, 1, 1, 0}}
  26.     Private Shared HexTable8 As Byte(,) =
  27.         {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 1, 1},
  28.          {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 1}, {0, 0, 0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, 0, 1, 1, 1},
  29.          {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 1}, {0, 0, 0, 0, 1, 0, 1, 0}, {0, 0, 0, 0, 1, 0, 1, 1},
  30.          {0, 0, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 1, 1, 0, 1}, {0, 0, 0, 0, 1, 1, 1, 0}, {0, 0, 0, 0, 1, 1, 1, 1},
  31.          {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0, 1, 0, 0, 1, 0}, {0, 0, 0, 1, 0, 0, 1, 1},
  32.          {0, 0, 0, 1, 0, 1, 0, 0}, {0, 0, 0, 1, 0, 1, 0, 1}, {0, 0, 0, 1, 0, 1, 1, 0}, {0, 0, 0, 1, 0, 1, 1, 1},
  33.          {0, 0, 0, 1, 1, 0, 0, 0}, {0, 0, 0, 1, 1, 0, 0, 1}, {0, 0, 0, 1, 1, 0, 1, 0}, {0, 0, 0, 1, 1, 0, 1, 1},
  34.          {0, 0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 0, 1}, {0, 0, 0, 1, 1, 1, 1, 0}, {0, 0, 0, 1, 1, 1, 1, 1},
  35.          {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 1}, {0, 0, 1, 0, 0, 0, 1, 0}, {0, 0, 1, 0, 0, 0, 1, 1},
  36.          {0, 0, 1, 0, 0, 1, 0, 0}, {0, 0, 1, 0, 0, 1, 0, 1}, {0, 0, 1, 0, 0, 1, 1, 0}, {0, 0, 1, 0, 0, 1, 1, 1},
  37.          {0, 0, 1, 0, 1, 0, 0, 0}, {0, 0, 1, 0, 1, 0, 0, 1}, {0, 0, 1, 0, 1, 0, 1, 0}, {0, 0, 1, 0, 1, 0, 1, 1},
  38.          {0, 0, 1, 0, 1, 1, 0, 0}, {0, 0, 1, 0, 1, 1, 0, 1}, {0, 0, 1, 0, 1, 1, 1, 0}, {0, 0, 1, 0, 1, 1, 1, 1},
  39.          {0, 0, 1, 1, 0, 0, 0, 0}, {0, 0, 1, 1, 0, 0, 0, 1}, {0, 0, 1, 1, 0, 0, 1, 0}, {0, 0, 1, 1, 0, 0, 1, 1},
  40.          {0, 0, 1, 1, 0, 1, 0, 0}, {0, 0, 1, 1, 0, 1, 0, 1}, {0, 0, 1, 1, 0, 1, 1, 0}, {0, 0, 1, 1, 0, 1, 1, 1},
  41.          {0, 0, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0, 1}, {0, 0, 1, 1, 1, 0, 1, 0}, {0, 0, 1, 1, 1, 0, 1, 1},
  42.          {0, 0, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 0, 1}, {0, 0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1},
  43.          {0, 1, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 1}, {0, 1, 0, 0, 0, 0, 1, 0}, {0, 1, 0, 0, 0, 0, 1, 1},
  44.          {0, 1, 0, 0, 0, 1, 0, 0}, {0, 1, 0, 0, 0, 1, 0, 1}, {0, 1, 0, 0, 0, 1, 1, 0}, {0, 1, 0, 0, 0, 1, 1, 1},
  45.          {0, 1, 0, 0, 1, 0, 0, 0}, {0, 1, 0, 0, 1, 0, 0, 1}, {0, 1, 0, 0, 1, 0, 1, 0}, {0, 1, 0, 0, 1, 0, 1, 1},
  46.          {0, 1, 0, 0, 1, 1, 0, 0}, {0, 1, 0, 0, 1, 1, 0, 1}, {0, 1, 0, 0, 1, 1, 1, 0}, {0, 1, 0, 0, 1, 1, 1, 1},
  47.          {0, 1, 0, 1, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 0, 0, 1}, {0, 1, 0, 1, 0, 0, 1, 0}, {0, 1, 0, 1, 0, 0, 1, 1},
  48.          {0, 1, 0, 1, 0, 1, 0, 0}, {0, 1, 0, 1, 0, 1, 0, 1}, {0, 1, 0, 1, 0, 1, 1, 0}, {0, 1, 0, 1, 0, 1, 1, 1},
  49.          {0, 1, 0, 1, 1, 0, 0, 0}, {0, 1, 0, 1, 1, 0, 0, 1}, {0, 1, 0, 1, 1, 0, 1, 0}, {0, 1, 0, 1, 1, 0, 1, 1},
  50.          {0, 1, 0, 1, 1, 1, 0, 0}, {0, 1, 0, 1, 1, 1, 0, 1}, {0, 1, 0, 1, 1, 1, 1, 0}, {0, 1, 0, 1, 1, 1, 1, 1},
  51.          {0, 1, 1, 0, 0, 0, 0, 0}, {0, 1, 1, 0, 0, 0, 0, 1}, {0, 1, 1, 0, 0, 0, 1, 0}, {0, 1, 1, 0, 0, 0, 1, 1},
  52.          {0, 1, 1, 0, 0, 1, 0, 0}, {0, 1, 1, 0, 0, 1, 0, 1}, {0, 1, 1, 0, 0, 1, 1, 0}, {0, 1, 1, 0, 0, 1, 1, 1},
  53.          {0, 1, 1, 0, 1, 0, 0, 0}, {0, 1, 1, 0, 1, 0, 0, 1}, {0, 1, 1, 0, 1, 0, 1, 0}, {0, 1, 1, 0, 1, 0, 1, 1},
  54.          {0, 1, 1, 0, 1, 1, 0, 0}, {0, 1, 1, 0, 1, 1, 0, 1}, {0, 1, 1, 0, 1, 1, 1, 0}, {0, 1, 1, 0, 1, 1, 1, 1},
  55.          {0, 1, 1, 1, 0, 0, 0, 0}, {0, 1, 1, 1, 0, 0, 0, 1}, {0, 1, 1, 1, 0, 0, 1, 0}, {0, 1, 1, 1, 0, 0, 1, 1},
  56.          {0, 1, 1, 1, 0, 1, 0, 0}, {0, 1, 1, 1, 0, 1, 0, 1}, {0, 1, 1, 1, 0, 1, 1, 0}, {0, 1, 1, 1, 0, 1, 1, 1},
  57.          {0, 1, 1, 1, 1, 0, 0, 0}, {0, 1, 1, 1, 1, 0, 0, 1}, {0, 1, 1, 1, 1, 0, 1, 0}, {0, 1, 1, 1, 1, 0, 1, 1},
  58.          {0, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0, 1}, {0, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1},
  59.          {1, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 1, 0}, {1, 0, 0, 0, 0, 0, 1, 1},
  60.          {1, 0, 0, 0, 0, 1, 0, 0}, {1, 0, 0, 0, 0, 1, 0, 1}, {1, 0, 0, 0, 0, 1, 1, 0}, {1, 0, 0, 0, 0, 1, 1, 1},
  61.          {1, 0, 0, 0, 1, 0, 0, 0}, {1, 0, 0, 0, 1, 0, 0, 1}, {1, 0, 0, 0, 1, 0, 1, 0}, {1, 0, 0, 0, 1, 0, 1, 1},
  62.          {1, 0, 0, 0, 1, 1, 0, 0}, {1, 0, 0, 0, 1, 1, 0, 1}, {1, 0, 0, 0, 1, 1, 1, 0}, {1, 0, 0, 0, 1, 1, 1, 1},
  63.          {1, 0, 0, 1, 0, 0, 0, 0}, {1, 0, 0, 1, 0, 0, 0, 1}, {1, 0, 0, 1, 0, 0, 1, 0}, {1, 0, 0, 1, 0, 0, 1, 1},
  64.          {1, 0, 0, 1, 0, 1, 0, 0}, {1, 0, 0, 1, 0, 1, 0, 1}, {1, 0, 0, 1, 0, 1, 1, 0}, {1, 0, 0, 1, 0, 1, 1, 1},
  65.          {1, 0, 0, 1, 1, 0, 0, 0}, {1, 0, 0, 1, 1, 0, 0, 1}, {1, 0, 0, 1, 1, 0, 1, 0}, {1, 0, 0, 1, 1, 0, 1, 1},
  66.          {1, 0, 0, 1, 1, 1, 0, 0}, {1, 0, 0, 1, 1, 1, 0, 1}, {1, 0, 0, 1, 1, 1, 1, 0}, {1, 0, 0, 1, 1, 1, 1, 1},
  67.          {1, 0, 1, 0, 0, 0, 0, 0}, {1, 0, 1, 0, 0, 0, 0, 1}, {1, 0, 1, 0, 0, 0, 1, 0}, {1, 0, 1, 0, 0, 0, 1, 1},
  68.          {1, 0, 1, 0, 0, 1, 0, 0}, {1, 0, 1, 0, 0, 1, 0, 1}, {1, 0, 1, 0, 0, 1, 1, 0}, {1, 0, 1, 0, 0, 1, 1, 1},
  69.          {1, 0, 1, 0, 1, 0, 0, 0}, {1, 0, 1, 0, 1, 0, 0, 1}, {1, 0, 1, 0, 1, 0, 1, 0}, {1, 0, 1, 0, 1, 0, 1, 1},
  70.          {1, 0, 1, 0, 1, 1, 0, 0}, {1, 0, 1, 0, 1, 1, 0, 1}, {1, 0, 1, 0, 1, 1, 1, 0}, {1, 0, 1, 0, 1, 1, 1, 1},
  71.          {1, 0, 1, 1, 0, 0, 0, 0}, {1, 0, 1, 1, 0, 0, 0, 1}, {1, 0, 1, 1, 0, 0, 1, 0}, {1, 0, 1, 1, 0, 0, 1, 1},
  72.          {1, 0, 1, 1, 0, 1, 0, 0}, {1, 0, 1, 1, 0, 1, 0, 1}, {1, 0, 1, 1, 0, 1, 1, 0}, {1, 0, 1, 1, 0, 1, 1, 1},
  73.          {1, 0, 1, 1, 1, 0, 0, 0}, {1, 0, 1, 1, 1, 0, 0, 1}, {1, 0, 1, 1, 1, 0, 1, 0}, {1, 0, 1, 1, 1, 0, 1, 1},
  74.          {1, 0, 1, 1, 1, 1, 0, 0}, {1, 0, 1, 1, 1, 1, 0, 1}, {1, 0, 1, 1, 1, 1, 1, 0}, {1, 0, 1, 1, 1, 1, 1, 1},
  75.          {1, 1, 0, 0, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0, 0, 1}, {1, 1, 0, 0, 0, 0, 1, 0}, {1, 1, 0, 0, 0, 0, 1, 1},
  76.          {1, 1, 0, 0, 0, 1, 0, 0}, {1, 1, 0, 0, 0, 1, 0, 1}, {1, 1, 0, 0, 0, 1, 1, 0}, {1, 1, 0, 0, 0, 1, 1, 1},
  77.          {1, 1, 0, 0, 1, 0, 0, 0}, {1, 1, 0, 0, 1, 0, 0, 1}, {1, 1, 0, 0, 1, 0, 1, 0}, {1, 1, 0, 0, 1, 0, 1, 1},
  78.          {1, 1, 0, 0, 1, 1, 0, 0}, {1, 1, 0, 0, 1, 1, 0, 1}, {1, 1, 0, 0, 1, 1, 1, 0}, {1, 1, 0, 0, 1, 1, 1, 1},
  79.          {1, 1, 0, 1, 0, 0, 0, 0}, {1, 1, 0, 1, 0, 0, 0, 1}, {1, 1, 0, 1, 0, 0, 1, 0}, {1, 1, 0, 1, 0, 0, 1, 1},
  80.          {1, 1, 0, 1, 0, 1, 0, 0}, {1, 1, 0, 1, 0, 1, 0, 1}, {1, 1, 0, 1, 0, 1, 1, 0}, {1, 1, 0, 1, 0, 1, 1, 1},
  81.          {1, 1, 0, 1, 1, 0, 0, 0}, {1, 1, 0, 1, 1, 0, 0, 1}, {1, 1, 0, 1, 1, 0, 1, 0}, {1, 1, 0, 1, 1, 0, 1, 1},
  82.          {1, 1, 0, 1, 1, 1, 0, 0}, {1, 1, 0, 1, 1, 1, 0, 1}, {1, 1, 0, 1, 1, 1, 1, 0}, {1, 1, 0, 1, 1, 1, 1, 1},
  83.          {1, 1, 1, 0, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0, 0, 1}, {1, 1, 1, 0, 0, 0, 1, 0}, {1, 1, 1, 0, 0, 0, 1, 1},
  84.          {1, 1, 1, 0, 0, 1, 0, 0}, {1, 1, 1, 0, 0, 1, 0, 1}, {1, 1, 1, 0, 0, 1, 1, 0}, {1, 1, 1, 0, 0, 1, 1, 1},
  85.          {1, 1, 1, 0, 1, 0, 0, 0}, {1, 1, 1, 0, 1, 0, 0, 1}, {1, 1, 1, 0, 1, 0, 1, 0}, {1, 1, 1, 0, 1, 0, 1, 1},
  86.          {1, 1, 1, 0, 1, 1, 0, 0}, {1, 1, 1, 0, 1, 1, 0, 1}, {1, 1, 1, 0, 1, 1, 1, 0}, {1, 1, 1, 0, 1, 1, 1, 1},
  87.          {1, 1, 1, 1, 0, 0, 0, 0}, {1, 1, 1, 1, 0, 0, 0, 1}, {1, 1, 1, 1, 0, 0, 1, 0}, {1, 1, 1, 1, 0, 0, 1, 1},
  88.          {1, 1, 1, 1, 0, 1, 0, 0}, {1, 1, 1, 1, 0, 1, 0, 1}, {1, 1, 1, 1, 0, 1, 1, 0}, {1, 1, 1, 1, 0, 1, 1, 1},
  89.          {1, 1, 1, 1, 1, 0, 0, 0}, {1, 1, 1, 1, 1, 0, 0, 1}, {1, 1, 1, 1, 1, 0, 1, 0}, {1, 1, 1, 1, 1, 0, 1, 1},
  90.          {1, 1, 1, 1, 1, 1, 0, 0}, {1, 1, 1, 1, 1, 1, 0, 1}, {1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 1, 1}}
  91.  
  92.     Public Shared Function Encode(ByVal Message As String) As Byte()
  93.         If Message = String.Empty Then Return {}
  94.         Dim FinalMessage As New List(Of Byte)
  95.         Dim OptMessage As New List(Of Byte)
  96.         Dim Bit As Integer
  97.         OptMessage.Add(1) : OptMessage.Add(0)
  98.         For i = 0 To Message.Length - 1
  99.             Bit = LtrNbr.IndexOf(Message(i))
  100.             If Bit = -1 Then
  101.                 FinalMessage.AddRange(System.Text.Encoding.UTF8.GetBytes(Message(i)))
  102.                 OptMessage.Add(1)
  103.                 OptMessage.Add(1)
  104.                 OptMessage.Add(1)
  105.                 OptMessage.Add(1)
  106.                 OptMessage.Add(1)
  107.                 OptMessage.Add(1)
  108.             Else
  109.                 OptMessage.Add(HexTable6(Bit, 0))
  110.                 OptMessage.Add(HexTable6(Bit, 1))
  111.                 OptMessage.Add(HexTable6(Bit, 2))
  112.                 OptMessage.Add(HexTable6(Bit, 3))
  113.                 OptMessage.Add(HexTable6(Bit, 4))
  114.                 OptMessage.Add(HexTable6(Bit, 5))
  115.             End If
  116.         Next
  117.         Bit = OptMessage.Count Mod 8
  118.         If Not Bit = 0 Then For i = 1 To 8 - Bit : OptMessage.Add(1) : Next
  119.         For i = 0 To OptMessage.Count - 1 Step 8
  120.             Bit = 0
  121.             If OptMessage(i) = 1 Then Bit += 128
  122.             If OptMessage(i + 1) = 1 Then Bit += 64
  123.             If OptMessage(i + 2) = 1 Then Bit += 32
  124.             If OptMessage(i + 3) = 1 Then Bit += 16
  125.             If OptMessage(i + 4) = 1 Then Bit += 8
  126.             If OptMessage(i + 5) = 1 Then Bit += 4
  127.             If OptMessage(i + 6) = 1 Then Bit += 2
  128.             If OptMessage(i + 7) = 1 Then Bit += 1
  129.             FinalMessage.Add(Bit)
  130.         Next
  131.         Return FinalMessage.ToArray
  132.     End Function
  133.  
  134.     Public Shared Function Decode(ByVal Message() As Byte) As String
  135.         If Message.Length = 0 Then Return String.Empty
  136.         Dim FinalMessage As New System.Text.StringBuilder
  137.         Dim NbrOfSpcChar As Integer = 0
  138.         Dim Bit As Integer = 0
  139.         Dim Phase As Integer = 1
  140.         Dim Rmdr As Integer = 0
  141.         For i = 0 To Message.Length - 1
  142.             Select Case Message(i)
  143.                 Case Is >= 252 : i += 5
  144.                 Case Is >= 248 : i += 4
  145.                 Case Is >= 240 : i += 3
  146.                 Case Is >= 224 : i += 2
  147.                 Case Is >= 192 : i += 1
  148.                 Case Is >= 128
  149.                     FinalMessage.Append(System.Text.Encoding.UTF8.GetString(Message.Take(i).ToArray))
  150.                     Message = Message.Skip(i).ToArray
  151.                     Exit For
  152.             End Select
  153.             NbrOfSpcChar += 1
  154.             If i = Message.Length - 1 Then Return System.Text.Encoding.UTF8.GetString(Message)
  155.         Next
  156.         If HexTable8(Message(0), 2) = 1 Then Bit += 32
  157.         If HexTable8(Message(0), 3) = 1 Then Bit += 16
  158.         If HexTable8(Message(0), 4) = 1 Then Bit += 8
  159.         If HexTable8(Message(0), 5) = 1 Then Bit += 4
  160.         If HexTable8(Message(0), 6) = 1 Then Bit += 2
  161.         If HexTable8(Message(0), 7) = 1 Then Bit += 1
  162.         If Not Bit = 63 Then
  163.             FinalMessage.Append(LtrNbr(Bit))
  164.         Else
  165.             If Not NbrOfSpcChar = 0 Then
  166.                 FinalMessage.Append(FinalMessage(0))
  167.                 FinalMessage.Remove(0, 1)
  168.                 NbrOfSpcChar -= 1
  169.             Else
  170.                 Return FinalMessage.ToString
  171.             End If
  172.         End If
  173.         Bit = 0
  174.         For i = 1 To Message.Length - 1
  175.             Select Case Phase
  176.                 Case 0
  177.                     If HexTable8(Message(i), 0) = 1 Then Bit += 2
  178.                     If HexTable8(Message(i), 1) = 1 Then Bit += 1
  179.                     Bit += Rmdr
  180.                     Rmdr = 0
  181.                     If Not Bit = 63 Then
  182.                         FinalMessage.Append(LtrNbr(Bit))
  183.                     Else
  184.                         If Not NbrOfSpcChar = 0 Then
  185.                             FinalMessage.Append(FinalMessage(0))
  186.                             FinalMessage.Remove(0, 1)
  187.                             NbrOfSpcChar -= 1
  188.                         Else
  189.                             Exit For
  190.                         End If
  191.                     End If
  192.                     Bit = 0
  193.                     If HexTable8(Message(i), 2) = 1 Then Bit += 32
  194.                     If HexTable8(Message(i), 3) = 1 Then Bit += 16
  195.                     If HexTable8(Message(i), 4) = 1 Then Bit += 8
  196.                     If HexTable8(Message(i), 5) = 1 Then Bit += 4
  197.                     If HexTable8(Message(i), 6) = 1 Then Bit += 2
  198.                     If HexTable8(Message(i), 7) = 1 Then Bit += 1
  199.                     If Not Bit = 63 Then
  200.                         FinalMessage.Append(LtrNbr(Bit))
  201.                     Else
  202.                         If Not NbrOfSpcChar = 0 Then
  203.                             FinalMessage.Append(FinalMessage(0))
  204.                             FinalMessage.Remove(0, 1)
  205.                             NbrOfSpcChar -= 1
  206.                         Else
  207.                             Exit For
  208.                         End If
  209.                     End If
  210.                     Bit = 0
  211.                     Phase += 1
  212.                 Case 1
  213.                     If HexTable8(Message(i), 0) = 1 Then Bit += 32
  214.                     If HexTable8(Message(i), 1) = 1 Then Bit += 16
  215.                     If HexTable8(Message(i), 2) = 1 Then Bit += 8
  216.                     If HexTable8(Message(i), 3) = 1 Then Bit += 4
  217.                     If HexTable8(Message(i), 4) = 1 Then Bit += 2
  218.                     If HexTable8(Message(i), 5) = 1 Then Bit += 1
  219.                     If Not Bit = 63 Then
  220.                         FinalMessage.Append(LtrNbr(Bit))
  221.                     Else
  222.                         If Not NbrOfSpcChar = 0 Then
  223.                             FinalMessage.Append(FinalMessage(0))
  224.                             FinalMessage.Remove(0, 1)
  225.                             NbrOfSpcChar -= 1
  226.                         Else
  227.                             Exit For
  228.                         End If
  229.                     End If
  230.                     Bit = 0
  231.                     If HexTable8(Message(i), 6) = 1 Then Rmdr += 32
  232.                     If HexTable8(Message(i), 7) = 1 Then Rmdr += 16
  233.                     Phase += 1
  234.                 Case 2
  235.                     If HexTable8(Message(i), 0) = 1 Then Bit += 8
  236.                     If HexTable8(Message(i), 1) = 1 Then Bit += 4
  237.                     If HexTable8(Message(i), 2) = 1 Then Bit += 2
  238.                     If HexTable8(Message(i), 3) = 1 Then Bit += 1
  239.                     Bit += Rmdr
  240.                     Rmdr = 0
  241.                     If Not Bit = 63 Then
  242.                         FinalMessage.Append(LtrNbr(Bit))
  243.                     Else
  244.                         If Not NbrOfSpcChar = 0 Then
  245.                             FinalMessage.Append(FinalMessage(0))
  246.                             FinalMessage.Remove(0, 1)
  247.                             NbrOfSpcChar -= 1
  248.                         Else
  249.                             Exit For
  250.                         End If
  251.                     End If
  252.                     Bit = 0
  253.                     If HexTable8(Message(i), 4) = 1 Then Rmdr += 32
  254.                     If HexTable8(Message(i), 5) = 1 Then Rmdr += 16
  255.                     If HexTable8(Message(i), 6) = 1 Then Rmdr += 8
  256.                     If HexTable8(Message(i), 7) = 1 Then Rmdr += 4
  257.                     Phase = 0
  258.             End Select
  259.         Next
  260.         Return FinalMessage.ToString
  261.     End Function
  262. End Class
');