Public Class Form1 Public Shared w As Integer = 32, r As Integer = 20 Public Shared ReadOnly e As Double = Math.E Public Const goldenRatio As Double = 1.61803398874965 Public Shared Pw As Integer = CInt(&HB7E15163), Qw As Integer = CInt(&H9E3779B9) Public Shared S As Integer() Public Shared Function convBytesWords(key As SByte(), u As Integer, c As Integer) As Integer() Dim i As Integer Dim tmp As Integer() = New Integer(c - 1) {} For i = 0 To tmp.Length - 1 tmp(i) = 0 Next i = 0 Dim off As Integer = 0 While i < c tmp(i) = ((key(System.Math.Max(System.Threading.Interlocked.Increment(off), off - 1)) And &HFF)) Or ((key(System.Math.Max(System.Threading.Interlocked.Increment(off), off - 1)) And &HFF) << 8) Or ((key(System.Math.Max(System.Threading.Interlocked.Increment(off), off - 1)) And &HFF) << 16) Or ((key(System.Math.Max(System.Threading.Interlocked.Increment(off), off - 1)) And &HFF) << 24) i += 1 End While Return tmp End Function Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim m As Integer m = Val(TextBox1.Text) Dim o As Integer = 4 Dim p As Integer = 4 TextBox2.Text = convBytesWords(m(), o, p) End Sub End Class
Encoding.GetString Method (Byte[], Int32, Int32)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)