Seems someone forgot 3 charsCode: Pascal [Select][+][-] function StringToHex(const s: ansistring): ansistring; begin if s='' then exit(s); BytesToHexStr(Result,@s[1],length(s)); end;