Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked [Función] HexStrToHex by Metal


Expermicid

Recommended Posts

Función:

 

[lenguaje=delphi]Function HexStrToHex(HexStr: string): string;

var

i: integer;

Impares, Pares: char;

begin

for i:= 1 to Length(HexStr) div 2 do

begin

Impares:= HexStr[2 * i - 1];

Pares:= HexStr[2 * i];

if i < Length(HexStr) div 2 then

Result:= Result + '$' + Impares + Pares + ','

else

Result:= Result + '$' + Impares + Pares;

end;

end;[/lenguaje]

 

Ejemplo de uso con una cadena de varios valores hexadecimales:

 

[lenguaje=delphi]Showmessage (HexStrToHex('4D535642564D36302E444C4C'));

 

//Nos devolverá $4D,$53,$56,$42,$56,$4D,$36,$30,$2E,$44,$4C,$4C [sin coma al final][/lenguaje]

 

Ejemplo de uso con una cadena de un valor hexadecimal:

 

[lenguaje=delphi]Showmessage (HexStrToHex('4D'));

 

//Nos devolverá $4D [También sin coma final][/lenguaje]

 

Credito: Metal_Kimgdom

Edited by Expermicid
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.