Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class TZ_Encoding
- Private LtrNbr As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "
- Private HexTable6 As Byte(,) =
- {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0},
- {0, 0, 0, 0, 1, 1}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 1, 0, 1},
- {0, 0, 0, 1, 1, 0}, {0, 0, 0, 1, 1, 1}, {0, 0, 1, 0, 0, 0},
- {0, 0, 1, 0, 0, 1}, {0, 0, 1, 0, 1, 0}, {0, 0, 1, 0, 1, 1},
- {0, 0, 1, 1, 0, 0}, {0, 0, 1, 1, 0, 1}, {0, 0, 1, 1, 1, 0},
- {0, 0, 1, 1, 1, 1}, {0, 1, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 1},
- {0, 1, 0, 0, 1, 0}, {0, 1, 0, 0, 1, 1}, {0, 1, 0, 1, 0, 0},
- {0, 1, 0, 1, 0, 1}, {0, 1, 0, 1, 1, 0}, {0, 1, 0, 1, 1, 1},
- {0, 1, 1, 0, 0, 0}, {0, 1, 1, 0, 0, 1}, {0, 1, 1, 0, 1, 0},
- {0, 1, 1, 0, 1, 1}, {0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 0, 1},
- {0, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 0, 0},
- {1, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 1, 0}, {1, 0, 0, 0, 1, 1},
- {1, 0, 0, 1, 0, 0}, {1, 0, 0, 1, 0, 1}, {1, 0, 0, 1, 1, 0},
- {1, 0, 0, 1, 1, 1}, {1, 0, 1, 0, 0, 0}, {1, 0, 1, 0, 0, 1},
- {1, 0, 1, 0, 1, 0}, {1, 0, 1, 0, 1, 1}, {1, 0, 1, 1, 0, 0},
- {1, 0, 1, 1, 0, 1}, {1, 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, 0, 1}, {1, 1, 1, 0, 0, 1, 1, 0}, {1, 1, 1, 0, 0, 1, 1, 1},
- {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},
- {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},
- {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},
- {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},
- {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},
- {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}}
- Public Function Encode(ByVal Message As String) As Byte()
- If Message = String.Empty Then Return {}
- Dim FinalMessage As New List(Of Byte)
- Dim OptMessage As New List(Of Byte)
- Dim Bit As Integer
- OptMessage.Add(1) : OptMessage.Add(0)
- For i = 0 To Message.Length - 1
- Bit = LtrNbr.IndexOf(Message(i))
- If Bit = -1 Then
- FinalMessage.AddRange(System.Text.Encoding.UTF8.GetBytes(Message(i)))
- OptMessage.Add(1)
- OptMessage.Add(1)
- OptMessage.Add(1)
- OptMessage.Add(1)
- OptMessage.Add(1)
- OptMessage.Add(1)
- Else
- OptMessage.Add(HexTable6(Bit, 0))
- OptMessage.Add(HexTable6(Bit, 1))
- OptMessage.Add(HexTable6(Bit, 2))
- OptMessage.Add(HexTable6(Bit, 3))
- OptMessage.Add(HexTable6(Bit, 4))
- OptMessage.Add(HexTable6(Bit, 5))
- End If
- Next
- Bit = OptMessage.Count Mod 8
- If Not Bit = 0 Then For i = 1 To 8 - Bit : OptMessage.Add(1) : Next
- For i = 0 To OptMessage.Count - 1 Step 8
- Bit = 0
- If OptMessage(i) = 1 Then Bit += 128
- If OptMessage(i + 1) = 1 Then Bit += 64
- If OptMessage(i + 2) = 1 Then Bit += 32
- If OptMessage(i + 3) = 1 Then Bit += 16
- If OptMessage(i + 4) = 1 Then Bit += 8
- If OptMessage(i + 5) = 1 Then Bit += 4
- If OptMessage(i + 6) = 1 Then Bit += 2
- If OptMessage(i + 7) = 1 Then Bit += 1
- FinalMessage.Add(Bit)
- Next
- Return FinalMessage.ToArray
- End Function
- Public Function Decode(ByVal Message() As Byte) As String
- If Message.Length = 0 Then Return String.Empty
- Dim FinalMessage As New System.Text.StringBuilder
- Dim SpcChars As New System.Text.StringBuilder
- Dim NbrOfSpcChar As UInteger = 0
- Dim Bit As Byte = 0
- Dim Phase As Byte = 1
- Dim Rmdr As Byte = 0
- Dim spcindex As UInteger = 0
- For i = 0 To Message.Length - 1
- Select Case Message(i)
- Case Is > 251 : i += 5
- Case Is > 247 : i += 4
- Case Is > 239 : i += 3
- Case Is > 223 : i += 2
- Case Is > 191 : i += 1
- Case Is > 127
- SpcChars.Append(System.Text.Encoding.UTF8.GetString(Message.Take(i).ToArray))
- Message = Message.Skip(i).ToArray
- Exit For
- End Select
- NbrOfSpcChar += 1
- If i = Message.Length - 1 Then Return System.Text.Encoding.UTF8.GetString(Message)
- Next
- If HexTable8(Message(0), 2) = 1 Then Bit += 32
- If HexTable8(Message(0), 3) = 1 Then Bit += 16
- If HexTable8(Message(0), 4) = 1 Then Bit += 8
- If HexTable8(Message(0), 5) = 1 Then Bit += 4
- If HexTable8(Message(0), 6) = 1 Then Bit += 2
- If HexTable8(Message(0), 7) = 1 Then Bit += 1
- If Bit = 63 Then
- If NbrOfSpcChar = 0 Then
- Return FinalMessage.ToString
- Else
- FinalMessage.Append(SpcChars(spcindex))
- spcindex += 1
- NbrOfSpcChar -= 1
- End If
- Else
- FinalMessage.Append(LtrNbr(Bit))
- End If
- Bit = 0
- For i = 1 To Message.Length - 1
- Select Case Phase
- Case 0
- If HexTable8(Message(i), 0) = 1 Then Bit += 2
- If HexTable8(Message(i), 1) = 1 Then Bit += 1
- Bit += Rmdr
- Rmdr = 0
- If Not Bit = 63 Then
- FinalMessage.Append(LtrNbr(Bit))
- Else
- If Not NbrOfSpcChar = 0 Then
- FinalMessage.Append(SpcChars(spcindex))
- spcindex += 1
- NbrOfSpcChar -= 1
- Else
- Exit For
- End If
- End If
- Bit = 0
- If HexTable8(Message(i), 2) = 1 Then Bit += 32
- If HexTable8(Message(i), 3) = 1 Then Bit += 16
- If HexTable8(Message(i), 4) = 1 Then Bit += 8
- If HexTable8(Message(i), 5) = 1 Then Bit += 4
- If HexTable8(Message(i), 6) = 1 Then Bit += 2
- If HexTable8(Message(i), 7) = 1 Then Bit += 1
- If Not Bit = 63 Then
- FinalMessage.Append(LtrNbr(Bit))
- Else
- If Not NbrOfSpcChar = 0 Then
- FinalMessage.Append(SpcChars(spcindex))
- spcindex += 1
- NbrOfSpcChar -= 1
- Else
- Exit For
- End If
- End If
- Bit = 0
- Phase += 1
- Case 1
- If HexTable8(Message(i), 0) = 1 Then Bit += 32
- If HexTable8(Message(i), 1) = 1 Then Bit += 16
- If HexTable8(Message(i), 2) = 1 Then Bit += 8
- If HexTable8(Message(i), 3) = 1 Then Bit += 4
- If HexTable8(Message(i), 4) = 1 Then Bit += 2
- If HexTable8(Message(i), 5) = 1 Then Bit += 1
- If Not Bit = 63 Then
- FinalMessage.Append(LtrNbr(Bit))
- Else
- If Not NbrOfSpcChar = 0 Then
- FinalMessage.Append(SpcChars(spcindex))
- spcindex += 1
- NbrOfSpcChar -= 1
- Else
- Exit For
- End If
- End If
- Bit = 0
- If HexTable8(Message(i), 6) = 1 Then Rmdr += 32
- If HexTable8(Message(i), 7) = 1 Then Rmdr += 16
- Phase += 1
- Case 2
- If HexTable8(Message(i), 0) = 1 Then Bit += 8
- If HexTable8(Message(i), 1) = 1 Then Bit += 4
- If HexTable8(Message(i), 2) = 1 Then Bit += 2
- If HexTable8(Message(i), 3) = 1 Then Bit += 1
- Bit += Rmdr
- Rmdr = 0
- If Not Bit = 63 Then
- FinalMessage.Append(LtrNbr(Bit))
- Else
- If Not NbrOfSpcChar = 0 Then
- FinalMessage.Append(SpcChars(spcindex))
- spcindex += 1
- NbrOfSpcChar -= 1
- Else
- Exit For
- End If
- End If
- Bit = 0
- If HexTable8(Message(i), 4) = 1 Then Rmdr += 32
- If HexTable8(Message(i), 5) = 1 Then Rmdr += 16
- If HexTable8(Message(i), 6) = 1 Then Rmdr += 8
- If HexTable8(Message(i), 7) = 1 Then Rmdr += 4
- Phase = 0
- End Select
- Next
- Return FinalMessage.ToString
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment