//一律转成大写字母
function ucase(c:char):char;
begin
if(c>='a') AND (c<='z') then
c:=char(byte(c)-$20);
ucase:=c;
end;
==========
//16进制字符转成对应数值
function hex2int(c:char):byte;
begin
if (c>='A')and(c<='F')
then
hex2int:=byte(c)-byte('A')+10
else
if (c>='a')AND (c<='f')
then
hex2int:=byte(c)-byte('a')+10
else
if(c>='0')AND(c<='9')
then
hex2int:=byte(c)-byte('0')
else
hex2int:=0;
end;
=========
function int2hex(v:byte):char;
const
hextable : array [0..15] of char=('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
begin
v:=v AND $f;
//只保留最低字节
int2hex:=hextable[v];
end;
=========