Código: Seleccionar todo

Function Zara(A : Variant; B : Integer): Variant;
{'=============================================================='}
{' Ax: Zara-128                                                 '}
{' Uso: Zara('Texto', 1/2) | Cifrar (1) - Descifrar (2)         '}
{'=============================================================='}

Var C : Integer;
Var D : String;
Begin

If Length(A) = 0 Then Exit;
C := 1;
If Not (B = 1) Then If Not (B = 2) Then Exit;

Case B Of
1: For C := 1 To Length(A) Do Begin D := D + IntToStr(Ord(Copy(A, C, 1)[1]) + 312) + ' '; end;
2: While C <= Length(A) Do Begin D := D + Chr(StrToInt(Copy(A, C, 3)) - 312); Inc(C, 4); end;
end;

Zara := D;
End;
Saludos.
Falta más información para este post, en que lenguaje, referencias, modo de uso, etc...
Delphi? creería yo
Responder

Volver a “Fuentes”