Visual Basic - Imposible!! ayuda please

Life is soft - evento anual de software empresarial
 
Vista:

Imposible!! ayuda please

Publicado por Sandra (1 intervención) el 01/07/2005 12:57:26
Tengo que pasar de visual basic a c++ un trozo de codigo (hace una especie de checksum) y ni siquiera lo entiendo en visual basic, es imposible saber que hacer, por favor que alguie me ayude!!!

Function CRC32(ByRef trama As String) As String
Dim dwCrc32 As Long
Dim i As Long

dwCrc32 = &HFFFFFFFF

Dim j As Integer, h As Integer

For j = 1 To Len(trama)
'recorremos la trama byte a byte
i = CLng(Asc(Mid(trama, j, 1))) Xor ((dwCrc32) And &HFF&)

For h = 1 To 8
If (i And 1) Then
i = ((i And &HFFFFFFFE) / 2) Xor &HEDB88320
Else
i = (i And CLng(&HFFFFFFFE)) / 2
End If
Next h
dwCrc32 = ((dwCrc32 And &HFFFFFF00) / (2 ^ 8)) Xor i
Next j

'convertimos a representación hexadecimal con 8 digitos
Dim repHex As String
repHex = Hex$(dwCrc32)
If Len(repHex) = 8 Then
CRC32 = repHex
Else
'Colocamos símbolos "0" al principio de la cadena
CRC32 = String$(8 - Len(repHex), "0") & repHex
End If

End Function

Si alguien me supiera explicar auqnue sea alguna linea, se lo agradeceria mucho. Besos y gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder