note 91091 added to mcrypt.examples
| From: | ricbalda at hotmail dot com | Date: | Mon, 25 May 2009 01:44:36 +0000 |
| Subject: | note 91091 added to mcrypt.examples | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-155950@lists.php.net to get a copy of this message | ||
Hola por espacio no fue posible poner todo el codigo VB9, aqui unas rutinas que faltaban
Codigo VB9
''' <summary>
''' HexToBytes: Converts a hex-encoded string to a byte array
''' </summary>
''' <param name="Hex"></param>
''' <returns></returns>
''' <remarks></remarks>
Private Shared Function HexToBytes(ByVal Hex As String) As Byte()
Dim numBytes As Integer = Hex.Length / 2
Dim bytes(numBytes - 1) As Byte
For n As Integer = 0 To numBytes - 1
Dim hexByte As String = Hex.Substring(n * 2, 2)
bytes(n) = Integer.Parse(hexByte, Globalization.NumberStyles.HexNumber)
Next
Return bytes
End Function
''' <summary>
''' BytesToHex: Converts a byte array to a hex-encoded string
''' </summary>
''' <param name="bytes"></param>
''' <returns></returns>
''' <remarks></remarks>
Private Shared Function BytesToHex(ByVal bytes() As Byte) As String
Dim hex As New StringBuilder
For n As Integer = 0 To bytes.Length - 1
hex.AppendFormat("{0:X2}", bytes(n))
Next
Return hex.ToString
End Function
Saludos
Ricardo Balda
----
Server IP: 209.41.74.194
Probable Submitter: 190.10.153.29
----
Manual Page -- http://www.php.net/manual/en/mcrypt.examples.php
Edit -- https://master.php.net/note/edit/91091
Del: integrated -- https://master.php.net/note/delete/91091/integrated
Del: useless -- https://master.php.net/note/delete/91091/useless
Del: bad code -- https://master.php.net/note/delete/91091/bad+code
Del: spam -- https://master.php.net/note/delete/91091/spam
Del: non-english -- https://master.php.net/note/delete/91091/non-english
Del: in docs -- https://master.php.net/note/delete/91091/in+docs
Del: other reasons-- https://master.php.net/note/delete/91091
Reject -- https://master.php.net/note/reject/91091
Search -- https://master.php.net/manage/user-notes.php