String to Hexadecimal

Submitted by:David Villa

Date added:06 February, 2013

Category:Delphi

Delphi code for String to Hexadecimal

Tags: hexadecimal convert , string convert

Code Snippet:

    function String2Hex(const Buffer: Ansistring): string;
var
n: Integer;
begin
Result := '';
for n := 1 to Length(Buffer) do
Result := LowerCase(Result + IntToHex(Ord(Buffer[n]), 2));
end;
 
 

Comments