Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Function Maszii_Enc(ByVal str As String) As String
- Dim chars As String = Regex.Replace(str, "[^01]", "")
- Dim arr((chars.Length / 2) - 1) As Byte
- For i As Integer = 0 To arr.Length - 1
- arr(i) = Convert.ToByte(chars.Substring(i * 2, 2), 2)
- Next
- Return ASCIIEncoding.ASCII.GetString(arr)
- (Byval ASCIIEncoding.ASCII.GetString(arr) As String) As String
- Dim out As New System.Text.StringBuilder
- For Each c As Char In input
- Dim temp As Integer = Asc(c) + 478
- out.Append(temp.ToString & "")
- Next
- Return out.ToString.Substring(0, out.Length - 1)
- End Function
- Private Function Mazii_Dec(ByVal str As String) As String
- Dim converted As New StringBuilder
- For Each b As Byte In ASCIIEncoding.ASCII.GetBytes(str)
- converted.Append(Convert.ToString(b, 2).PadLeft(2, "0"))
- Next
- Return converted.ToString()
- Byval converted.ToString As String) As String
- (Byval converted.ToString As String) As String
- Dim out As New System.Text.StringBuilder
- Dim data As String() = Split(input, "")
- For Each s As String In data
- out.Append(Chr(Asc(s) - 478))
- Next
- Return out.ToString
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement